X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=ssl%2Fquic%2Fquic_channel.c;h=aed911ad9fdcc03a92e4c479f03fd40535cdede5;hb=29fbdfafafcc5fa705f445a9f63ddd8207bf9f06;hp=0b1eea2babd3c16dcad521cdb9289c1cd1e27c71;hpb=4760116f5a1d30ad57819eec993c8cce61192477;p=openssl.git diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 0b1eea2bab..aed911ad9f 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -102,22 +102,6 @@ static void ch_raise_version_neg_failure(QUIC_CHANNEL *ch); DEFINE_LHASH_OF_EX(QUIC_SRT_ELEM); -static int gen_rand_conn_id(OSSL_LIB_CTX *libctx, size_t len, QUIC_CONN_ID *cid) -{ - if (len > QUIC_MAX_CONN_ID_LEN) - return 0; - - cid->id_len = (unsigned char)len; - - if (RAND_bytes_ex(libctx, cid->id, len, len * 8) != 1) { - ERR_raise(ERR_LIB_SSL, ERR_R_RAND_LIB); - cid->id_len = 0; - return 0; - } - - return 1; -} - /* * QUIC Channel Initialization and Teardown * ======================================== @@ -145,7 +129,8 @@ static int ch_init(QUIC_CHANNEL *ch) /* For clients, generate our initial DCID. */ if (!ch->is_server - && !gen_rand_conn_id(ch->port->libctx, tx_init_dcid_len, &ch->init_dcid)) + && !ossl_quic_gen_rand_conn_id(ch->port->libctx, tx_init_dcid_len, + &ch->init_dcid)) goto err; /* We plug in a network write BIO to the QTX later when we get one. */