diff options
author | delphij <delphij@FreeBSD.org> | 2017-01-27 07:45:06 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2017-01-27 07:45:06 +0000 |
commit | a12ba8665d8c2f94852d5f819104a9a69bc4c8b7 (patch) | |
tree | 46fa379ff9c2760fa064fdbbbdb211ab408a520b | |
parent | 8d20a52909cad330e23205cdc1685bd0bdd7c4f7 (diff) | |
download | FreeBSD-src-a12ba8665d8c2f94852d5f819104a9a69bc4c8b7.zip FreeBSD-src-a12ba8665d8c2f94852d5f819104a9a69bc4c8b7.tar.gz |
Backport OpenSSL commit 56336b6c7a75ed28067cadedd8ac46572348bc2f:
crypto/evp: harden RC4_MD5 cipher.
Originally a crash in 32-bit build was reported CHACHA20-POLY1305
cipher. The crash is triggered by truncated packet and is result
of excessive hashing to the edge of accessible memory (or bogus
MAC value is produced if x86 MD5 assembly module is involved). Since
hash operation is read-only it is not considered to be exploitable
beyond a DoS condition.
Thanks to Robert Święcki for report.
This is a direct commit to stable/10.
Security: CVE-2017-3731
-rw-r--r-- | crypto/openssl/crypto/evp/e_rc4_hmac_md5.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c b/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c index 2da1117..ca53913 100644 --- a/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c +++ b/crypto/openssl/crypto/evp/e_rc4_hmac_md5.c @@ -267,6 +267,8 @@ static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, len = p[arg - 2] << 8 | p[arg - 1]; if (!ctx->encrypt) { + if (len < MD5_DIGEST_LENGTH) + return -1; len -= MD5_DIGEST_LENGTH; p[arg - 2] = len >> 8; p[arg - 1] = len; |