From db1a505ced696b104b03a072079e663cceecf692 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 21 Jul 2022 15:13:46 +0100 Subject: [PATCH] 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) --- ssl/record/rec_layer_s3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.47.2