FreeBSD/sys/netinet/sctp_auth.c
/*
 * generate a new random key of length 'keylen'
 */
generate a new random key of length 'keylen'
generate a new random key of length ' keylen '
sctp_key_t *
sctp_generate_random_key(uint32_t keylen)
{
	sctp_key_t *new_key;
	new_key = sctp_alloc_key(keylen);
	if (new_key == NULL) {
		return (NULL);
	}
	SCTP_READ_RANDOM(new_key->key, keylen);
	new_key->keylen = keylen;
	return (new_key);
}
sctp_key_t * sctp_generate_random_key ( uint32_t keylen ) { sctp_key_t * new_key ; new_key = sctp_alloc_key ( keylen ) ; if ( new_key == NULL ) { return ( NULL ) ; } SCTP_READ_RANDOM ( new_key -> key , keylen ) ; new_key -> keylen = keylen ; return ( new_key ) ; }
generate a new random key of length 'keylen'
generate a new random key of length ' keylen '
/* out of memory */