Skip to content

Commit

Permalink
tls_post_encryption_processing_default() and tls_validate_record_head…
Browse files Browse the repository at this point in the history
…er()

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #22376)
  • Loading branch information
fwh-dc authored and t8m committed Apr 26, 2024
1 parent 553fcfb commit 789f7c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ssl/record/methods/tls_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,12 +1702,13 @@ int tls_post_encryption_processing_default(OSSL_RECORD_LAYER *rl,

if (rl->msg_callback != NULL) {
unsigned char *recordstart;
const int version1_3 = rl->isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;

recordstart = WPACKET_get_curr(thispkt) - len - headerlen;
rl->msg_callback(1, thiswr->rec_version, SSL3_RT_HEADER, recordstart,
headerlen, rl->cbarg);

if (rl->version == TLS1_3_VERSION && rl->enc_ctx != NULL) {
if (rl->version == version1_3 && rl->enc_ctx != NULL) {
unsigned char ctype = thistempl->type;

rl->msg_callback(1, thiswr->rec_version, SSL3_RT_INNER_CONTENT_TYPE,
Expand Down
4 changes: 3 additions & 1 deletion ssl/record/methods/tlsany_meth.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ static int tls_validate_record_header(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)
return 0;
}
} else {
const int version1_3 = rl->isdtls ? DTLS1_3_VERSION : TLS1_3_VERSION;

if (rl->version == TLS_ANY_VERSION) {
if ((rec->rec_version >> 8) != SSL3_VERSION_MAJOR) {
if (rl->is_first_record) {
Expand Down Expand Up @@ -86,7 +88,7 @@ static int tls_validate_record_header(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)
return 0;
}
}
} else if (rl->version == TLS1_3_VERSION) {
} else if (rl->version == version1_3) {
/*
* In this case we know we are going to negotiate TLSv1.3, but we've
* had an HRR, so we haven't actually done so yet. In TLSv1.3 we
Expand Down

0 comments on commit 789f7c6

Please sign in to comment.