Browse code

Fixing Security bug 1731135/CVE-2016-6303

Change-Id: I26e52230697ba6d73d70a6aeb2beafd1cffca5c6
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1424
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

Kumar Kaushik authored on 2016/09/21 07:09:41
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+From 2b4029e68fd7002d2307e6c3cde0f3784eef9c83 Mon Sep 17 00:00:00 2001
1
+From: "Dr. Stephen Henson" <steve@openssl.org>
2
+Date: Fri, 19 Aug 2016 23:28:29 +0100
3
+Subject: [PATCH] Avoid overflow in MDC2_Update()
4
+
5
+Thanks to Shi Lei for reporting this issue.
6
+
7
+CVE-2016-6303
8
+
9
+Reviewed-by: Matt Caswell <matt@openssl.org>
10
+(cherry picked from commit 55d83bf7c10c7b205fffa23fa7c3977491e56c07)
11
+---
12
+ crypto/mdc2/mdc2dgst.c | 2 +-
13
+ 1 file changed, 1 insertion(+), 1 deletion(-)
14
+
15
+diff --git a/crypto/mdc2/mdc2dgst.c b/crypto/mdc2/mdc2dgst.c
16
+index 6615cf8..2dce493 100644
17
+--- a/crypto/mdc2/mdc2dgst.c
18
+@@ -91,7 +91,7 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len)
19
+ 
20
+     i = c->num;
21
+     if (i != 0) {
22
+-        if (i + len < MDC2_BLOCK) {
23
++        if (len < MDC2_BLOCK - i) {
24
+             /* partial block */
25
+             memcpy(&(c->data[i]), in, len);
26
+             c->num += (int)len;
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Management tools and libraries relating to cryptography
2 2
 Name:		openssl
3 3
 Version:	1.0.2h
4
-Release:	3%{?dist}
4
+Release:	4%{?dist}
5 5
 License:	OpenSSL
6 6
 URL:		http://www.openssl.org
7 7
 Group:		System Environment/Security
... ...
@@ -13,6 +13,7 @@ Patch0:		c_rehash.patch
13 13
 Patch1:         openssl-1.0.2f-ipv6apps.patch
14 14
 Patch2:         openssl-init-conslidate.patch
15 15
 Patch3:         openssl-use-fips-drbg-by-default.patch
16
+Patch4:         CVE-2016-6303.patch
16 17
 Requires:	bash glibc libgcc 
17 18
 
18 19
 %description
... ...
@@ -53,6 +54,7 @@ Perl scripts that convert certificates and keys to various formats.
53 53
 %patch1 -p1
54 54
 %patch2 -p1
55 55
 %patch3 -p1
56
+%patch4 -p1
56 57
 
57 58
 %build
58 59
 export CFLAGS="%{optflags}"
... ...
@@ -112,6 +114,8 @@ rm -rf %{buildroot}/*
112 112
 /%{_bindir}/c_rehash
113 113
 
114 114
 %changelog
115
+*   Tue Sep 20 2016 Kumar Kaushik <kaushikk@vmware.com> 1.0.2h-4
116
+-   Security bug fix, CVE-2016-6303.
115 117
 *   Fri Jun 22 2016 Anish Swaminathan <anishs@vmware.com> 1.0.2h-3
116 118
 -   Add patches for using openssl_init under all initialization and changing default RAND
117 119
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.2h-2