From 8bdea4401a054f46313b366cd7691a0dd110c7da Mon Sep 17 00:00:00 2001 From: guenther <> Date: Sun, 2 Oct 2016 21:05:44 +0000 Subject: Detect zero-length encrypted session data early, instead of when malloc(0) fails or the HMAC check fails. Noted independently by jsing@ and Kurt Cancemi (kurt (at) x64architecture.com) ok bcook@ --- src/lib/libssl/t1_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index 3f66e2e6d0..67eabdae06 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t1_lib.c,v 1.90 2016/09/22 12:33:50 jsing Exp $ */ +/* $OpenBSD: t1_lib.c,v 1.91 2016/10/02 21:05:44 guenther Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2225,7 +2225,7 @@ tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, } /* Sanity check ticket length: must exceed keyname + IV + HMAC */ - if (eticklen < 16 + EVP_CIPHER_CTX_iv_length(&ctx) + mlen) { + if (eticklen <= 16 + EVP_CIPHER_CTX_iv_length(&ctx) + mlen) { HMAC_CTX_cleanup(&hctx); EVP_CIPHER_CTX_cleanup(&ctx); return 2; -- cgit v1.2.3-55-g6feb