diff options
author | 2016-10-02 21:05:44 +0000 | |
---|---|---|
committer | 2016-10-02 21:05:44 +0000 | |
commit | 966e7d0ebaa9d26d5e2401272dd5bc0271223fe5 (patch) | |
tree | 45d4b7e2d63e6cef5e98dd53ffe06034519fa5d8 /lib/libssl/t1_lib.c | |
parent | In X509_cmp_time(), pass asn1_time_parse() the tag of the field being (diff) | |
download | wireguard-openbsd-966e7d0ebaa9d26d5e2401272dd5bc0271223fe5.tar.xz wireguard-openbsd-966e7d0ebaa9d26d5e2401272dd5bc0271223fe5.zip |
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@
Diffstat (limited to 'lib/libssl/t1_lib.c')
-rw-r--r-- | lib/libssl/t1_lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/t1_lib.c b/lib/libssl/t1_lib.c index 3f66e2e6d0b..67eabdae06f 100644 --- a/lib/libssl/t1_lib.c +++ b/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; |