summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch')
-rw-r--r--meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch b/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch
new file mode 100644
index 0000000000..b56b2d5bd3
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/0002-CVE-2017-3731.patch
@@ -0,0 +1,53 @@
1From 6427f1accc54b515bb899370f1a662bfcb1caa52 Mon Sep 17 00:00:00 2001
2From: Alexandru Moise <alexandru.moise@windriver.com>
3Date: Tue, 7 Feb 2017 11:16:13 +0200
4Subject: [PATCH 2/2] crypto/evp: harden AEAD ciphers.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Originally a crash in 32-bit build was reported CHACHA20-POLY1305
10cipher. The crash is triggered by truncated packet and is result
11of excessive hashing to the edge of accessible memory. Since hash
12operation is read-only it is not considered to be exploitable
13beyond a DoS condition. Other ciphers were hardened.
14
15Thanks to Robert Święcki for report.
16
17CVE-2017-3731
18
19Backported from upstream commit:
202198b3a55de681e1f3c23edb0586afe13f438051
21
22Upstream-Status: Backport
23
24Reviewed-by: Rich Salz <rsalz@openssl.org>
25Signed-off-by: Alexandru Moise <alexandru.moise@windriver.com>
26---
27 crypto/evp/e_aes.c | 7 ++++++-
28 1 file changed, 6 insertions(+), 1 deletion(-)
29
30diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
31index 1734a82..16dcd10 100644
32--- a/crypto/evp/e_aes.c
33+++ b/crypto/evp/e_aes.c
34@@ -1235,10 +1235,15 @@ static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
35 {
36 unsigned int len = c->buf[arg - 2] << 8 | c->buf[arg - 1];
37 /* Correct length for explicit IV */
38+ if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN)
39+ return 0;
40 len -= EVP_GCM_TLS_EXPLICIT_IV_LEN;
41 /* If decrypting correct for tag too */
42- if (!c->encrypt)
43+ if (!c->encrypt) {
44+ if (len < EVP_GCM_TLS_TAG_LEN)
45+ return 0;
46 len -= EVP_GCM_TLS_TAG_LEN;
47+ }
48 c->buf[arg - 2] = len >> 8;
49 c->buf[arg - 1] = len & 0xff;
50 }
51--
522.10.2
53