From: Matt Caswell Date: Thu, 21 Jul 2022 14:13:46 +0000 (+0100) Subject: Ensure we use a dgram mem BIO for the DTLS record layer X-Git-Tag: openssl-3.2.0-alpha1~2217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db1a505ced696b104b03a072079e663cceecf692;p=thirdparty%2Fopenssl.git Ensure we use a dgram mem BIO for the DTLS record layer Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18132) --- diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index b6955562116..30796f2024a 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -1893,7 +1893,10 @@ int ssl_set_new_record_layer(SSL_CONNECTION *s, int version, && level != OSSL_RECORD_PROTECTION_LEVEL_NONE) epoch = DTLS_RECORD_LAYER_get_r_epoch(&s->rlayer) + 1; /* new epoch */ - s->rrlnext = BIO_new(BIO_s_mem()); + if (SSL_CONNECTION_IS_DTLS(s)) + s->rrlnext = BIO_new(BIO_s_dgram_mem()); + else + s->rrlnext = BIO_new(BIO_s_mem()); if (s->rrlnext == NULL) { BIO_free(prev);