]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Ensure we use a dgram mem BIO for the DTLS record layer
authorMatt Caswell <matt@openssl.org>
Thu, 21 Jul 2022 14:13:46 +0000 (15:13 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Aug 2022 15:38:13 +0000 (16:38 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

ssl/record/rec_layer_s3.c

index b695556211606b2051d607c2c75b014c6b990bdd..30796f2024a2e78b7e023c19354aef8b2febbbed 100644 (file)
@@ -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);