summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_pkt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_pkt.c')
-rw-r--r--src/lib/libssl/ssl_pkt.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libssl/ssl_pkt.c b/src/lib/libssl/ssl_pkt.c
index c6ec67545d..8126c42d1d 100644
--- a/src/lib/libssl/ssl_pkt.c
+++ b/src/lib/libssl/ssl_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_pkt.c,v 1.20 2020/02/23 17:59:03 tb Exp $ */ 1/* $OpenBSD: ssl_pkt.c,v 1.21 2020/03/10 17:02:21 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -431,18 +431,16 @@ ssl3_get_record(SSL *s)
431 /* decrypt in place in 'rr->input' */ 431 /* decrypt in place in 'rr->input' */
432 rr->data = rr->input; 432 rr->data = rr->input;
433 433
434 enc_err = s->method->internal->ssl3_enc->enc(s, 0);
435 /* enc_err is: 434 /* enc_err is:
436 * 0: (in non-constant time) if the record is publically invalid. 435 * 0: (in non-constant time) if the record is publically invalid.
437 * 1: if the padding is valid 436 * 1: if the padding is valid
438 * -1: if the padding is invalid */ 437 * -1: if the padding is invalid */
439 if (enc_err == 0) { 438 if ((enc_err = tls1_enc(s, 0)) == 0) {
440 al = SSL_AD_BAD_RECORD_MAC; 439 al = SSL_AD_BAD_RECORD_MAC;
441 SSLerror(s, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); 440 SSLerror(s, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG);
442 goto f_err; 441 goto f_err;
443 } 442 }
444 443
445
446 /* r->length is now the compressed data plus mac */ 444 /* r->length is now the compressed data plus mac */
447 if ((sess != NULL) && (s->enc_read_ctx != NULL) && 445 if ((sess != NULL) && (s->enc_read_ctx != NULL) &&
448 (EVP_MD_CTX_md(s->read_hash) != NULL)) { 446 (EVP_MD_CTX_md(s->read_hash) != NULL)) {
@@ -705,8 +703,8 @@ ssl3_create_record(SSL *s, unsigned char *p, int type, const unsigned char *buf,
705 wr->length += eivlen; 703 wr->length += eivlen;
706 } 704 }
707 705
708 /* ssl3_enc can only have an error on read */ 706 /* tls1_enc can only have an error on read */
709 s->method->internal->ssl3_enc->enc(s, 1); 707 tls1_enc(s, 1);
710 708
711 /* record length after mac and block padding */ 709 /* record length after mac and block padding */
712 if (!CBB_add_u16(&cbb, wr->length)) 710 if (!CBB_add_u16(&cbb, wr->length))