MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_fill_random_store

Function sctp_fill_random_store

freebsd/netinet/sctputil.c:991–1008  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991void
992sctp_fill_random_store(struct sctp_pcb *m)
993{
994 /*
995 * Here we use the MD5/SHA-1 to hash with our good randomNumbers and
996 * our counter. The result becomes our good random numbers and we
997 * then setup to give these out. Note that we do no locking to
998 * protect this. This is ok, since if competing folks call this we
999 * will get more gobbled gook in the random store which is what we
1000 * want. There is a danger that two guys will use the same random
1001 * numbers, but thats ok too since that is random as well :->
1002 */
1003 m->store_at = 0;
1004 (void)sctp_hmac(SCTP_HMAC, (uint8_t *)m->random_numbers,
1005 sizeof(m->random_numbers), (uint8_t *)&m->random_counter,
1006 sizeof(m->random_counter), (uint8_t *)m->random_store);
1007 m->random_counter++;
1008}
1009
1010uint32_t
1011sctp_select_initial_TSN(struct sctp_pcb *inp)

Callers 2

sctp_select_initial_TSNFunction · 0.85
sctp_inpcb_allocFunction · 0.85

Calls 1

sctp_hmacFunction · 0.85

Tested by

no test coverage detected