summaryrefslogtreecommitdiff
path: root/lib/libssl/d1_pkt.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2020-08-02 07:33:16 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2020-08-02 07:33:16 +0000
commitab790b63ef29d426583fa1a27e7e10bee9dff3a4 (patch)
tree727b96b289001be3982b6c1a567a14dc0bfd3eba /lib/libssl/d1_pkt.c
parent022ffcc23a5b1c5c542e5b571b62dffa45c1cdcc (diff)
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 'lib/libssl/d1_pkt.c')
-rw-r--r--lib/libssl/d1_pkt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libssl/d1_pkt.c b/lib/libssl/d1_pkt.c
index f888592223c..0caf2a59656 100644
--- a/lib/libssl/d1_pkt.c
+++ b/lib/libssl/d1_pkt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_pkt.c,v 1.75 2020/08/01 16:50:16 jsing Exp $ */
+/* $OpenBSD: d1_pkt.c,v 1.76 2020/08/02 07:33:15 jsing Exp $ */
/*
* DTLS implementation written by Nagendra Modadugu
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -1254,8 +1254,8 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len)
wr->input = p;
wr->length += eivlen;
- /* tls1_enc can only have an error on read */
- tls1_enc(s, 1);
+ if (tls1_enc(s, 1) != 1)
+ goto err;
if (!CBB_add_u16(&cbb, wr->length))
goto err;