summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_pkt.c
diff options
context:
space:
mode:
authorjsing <>2020-08-02 07:33:15 +0000
committerjsing <>2020-08-02 07:33:15 +0000
commit2bc9beff4e7e4404b48e98e8c4bccfe464a47b90 (patch)
tree648614eca61abf8dd8fd8cdfff2634a209e3f694 /src/lib/libssl/ssl_pkt.c
parent6e5d9da264e1017a10d374a9ba566f293528170e (diff)
downloadopenbsd-2bc9beff4e7e4404b48e98e8c4bccfe464a47b90.tar.gz
openbsd-2bc9beff4e7e4404b48e98e8c4bccfe464a47b90.tar.bz2
openbsd-2bc9beff4e7e4404b48e98e8c4bccfe464a47b90.zip
Check the return value of tls1_enc() in the write path.
The write path can return a failure in the AEAD path and there is no reason not to check a return value. Spotted by tb@ during another review. ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_pkt.c')
-rw-r--r--src/lib/libssl/ssl_pkt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_pkt.c b/src/lib/libssl/ssl_pkt.c
index 6bb722098a..39ce46381d 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.27 2020/08/01 16:50:16 jsing Exp $ */ 1/* $OpenBSD: ssl_pkt.c,v 1.28 2020/08/02 07:33:15 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 *
@@ -674,8 +674,8 @@ ssl3_create_record(SSL *s, unsigned char *p, uint16_t version, uint8_t type,
674 wr->input = p; 674 wr->input = p;
675 wr->length += eivlen; 675 wr->length += eivlen;
676 676
677 /* tls1_enc can only have an error on read */ 677 if (tls1_enc(s, 1) != 1)
678 tls1_enc(s, 1); 678 goto err;
679 679
680 /* record length after mac and block padding */ 680 /* record length after mac and block padding */
681 if (!CBB_add_u16(&cbb, wr->length)) 681 if (!CBB_add_u16(&cbb, wr->length))