From: Frederik Wedel-Heinen Date: Mon, 2 Oct 2023 09:11:29 +0000 (+0200) Subject: Pass the dtls record version to the record layer msg_callback function. X-Git-Tag: openssl-3.2.0-beta1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b31597d989f422a0d341be4946d4d64a9251047f;p=thirdparty%2Fopenssl.git Pass the dtls record version to the record layer msg_callback function. Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22241) --- diff --git a/ssl/record/methods/dtls_meth.c b/ssl/record/methods/dtls_meth.c index e71730eba65..258dbd3b14a 100644 --- a/ssl/record/methods/dtls_meth.c +++ b/ssl/record/methods/dtls_meth.c @@ -429,10 +429,6 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl) p = rl->packet; - if (rl->msg_callback != NULL) - rl->msg_callback(0, 0, SSL3_RT_HEADER, p, DTLS1_RT_HEADER_LENGTH, - rl->cbarg); - /* Pull apart the header into the DTLS1_RECORD */ rr->type = *(p++); ssl_major = *(p++); @@ -447,6 +443,10 @@ int dtls_get_more_records(OSSL_RECORD_LAYER *rl) n2s(p, rr->length); + if (rl->msg_callback != NULL) + rl->msg_callback(0, rr->rec_version, SSL3_RT_HEADER, rl->packet, DTLS1_RT_HEADER_LENGTH, + rl->cbarg); + /* * Lets check the version. We tolerate alerts that don't have the exact * version number (e.g. because of protocol version errors)