diff options
author | guenther <> | 2016-10-02 21:05:44 +0000 |
---|---|---|
committer | guenther <> | 2016-10-02 21:05:44 +0000 |
commit | 8bdea4401a054f46313b366cd7691a0dd110c7da (patch) | |
tree | 88ebce21f44773a590a23994b4990290c8e2107e | |
parent | 32f9250f554f0962dd3dce5496156b8c315715ca (diff) | |
download | openbsd-8bdea4401a054f46313b366cd7691a0dd110c7da.tar.gz openbsd-8bdea4401a054f46313b366cd7691a0dd110c7da.tar.bz2 openbsd-8bdea4401a054f46313b366cd7691a0dd110c7da.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@
-rw-r--r-- | src/lib/libssl/t1_lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 @@ | |||
1 | /* $OpenBSD: t1_lib.c,v 1.90 2016/09/22 12:33:50 jsing Exp $ */ | 1 | /* $OpenBSD: t1_lib.c,v 1.91 2016/10/02 21:05:44 guenther 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 | * |
@@ -2225,7 +2225,7 @@ tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | |||
2225 | } | 2225 | } |
2226 | 2226 | ||
2227 | /* Sanity check ticket length: must exceed keyname + IV + HMAC */ | 2227 | /* Sanity check ticket length: must exceed keyname + IV + HMAC */ |
2228 | if (eticklen < 16 + EVP_CIPHER_CTX_iv_length(&ctx) + mlen) { | 2228 | if (eticklen <= 16 + EVP_CIPHER_CTX_iv_length(&ctx) + mlen) { |
2229 | HMAC_CTX_cleanup(&hctx); | 2229 | HMAC_CTX_cleanup(&hctx); |
2230 | EVP_CIPHER_CTX_cleanup(&ctx); | 2230 | EVP_CIPHER_CTX_cleanup(&ctx); |
2231 | return 2; | 2231 | return 2; |