From 2bc9beff4e7e4404b48e98e8c4bccfe464a47b90 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 2 Aug 2020 07:33:15 +0000 Subject: 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@ --- src/lib/libssl/ssl_pkt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libssl/ssl_pkt.c') 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 @@ -/* $OpenBSD: ssl_pkt.c,v 1.27 2020/08/01 16:50:16 jsing Exp $ */ +/* $OpenBSD: ssl_pkt.c,v 1.28 2020/08/02 07:33:15 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -674,8 +674,8 @@ ssl3_create_record(SSL *s, unsigned char *p, uint16_t version, uint8_t type, 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; /* record length after mac and block padding */ if (!CBB_add_u16(&cbb, wr->length)) -- cgit v1.2.3-55-g6feb