Fix ASN1_INTEGER handling 86/133386/3
authorjaekuk, lee <juku1999@samsung.com>
Mon, 12 Jun 2017 04:24:12 +0000 (13:24 +0900)
committerjaekuk lee <juku1999@samsung.com>
Mon, 12 Jun 2017 04:28:30 +0000 (04:28 +0000)
https://nvd.nist.gov/vuln/detail/CVE-2016-2108

https://git.openssl.org/?p=openssl.git;a=commit;h=f5da52e308a6aeea6d5f3df98c4da295d7e9cc27
Only treat an ASN1_ANY type as an integer if it has the V_ASN1_INTEGER
tag: V_ASN1_NEG_INTEGER is an internal only value which is never used
for on the wire encoding.
Thanks to David Benjamin <davidben@google.com> for reporting this bug.
This was found using libFuzzer.
RT#4364 (part)CVE-2016-2108.

Change-Id: I51260381d49ce01ea061a35d028e13f8b4c120f7
Signed-off-by: jaekuk, lee <juku1999@samsung.com>
deps/openssl/openssl/crypto/asn1/a_type.c [changed mode: 0644->0755]
deps/openssl/openssl/crypto/asn1/tasn_dec.c [changed mode: 0644->0755]
deps/openssl/openssl/crypto/asn1/tasn_enc.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index af79530..bb166e8
@@ -126,9 +126,7 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
         result = 0;             /* They do not have content. */
         break;
     case V_ASN1_INTEGER:
-    case V_ASN1_NEG_INTEGER:
     case V_ASN1_ENUMERATED:
-    case V_ASN1_NEG_ENUMERATED:
     case V_ASN1_BIT_STRING:
     case V_ASN1_OCTET_STRING:
     case V_ASN1_SEQUENCE:
old mode 100644 (file)
new mode 100755 (executable)
index 5a50796..6bdcd5c
@@ -901,9 +901,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
         break;
 
     case V_ASN1_INTEGER:
-    case V_ASN1_NEG_INTEGER:
     case V_ASN1_ENUMERATED:
-    case V_ASN1_NEG_ENUMERATED:
         tint = (ASN1_INTEGER **)pval;
         if (!c2i_ASN1_INTEGER(tint, &cont, len))
             goto err;
old mode 100644 (file)
new mode 100755 (executable)
index f04a689..f7f83e5
@@ -611,9 +611,7 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
         break;
 
     case V_ASN1_INTEGER:
-    case V_ASN1_NEG_INTEGER:
     case V_ASN1_ENUMERATED:
-    case V_ASN1_NEG_ENUMERATED:
         /*
          * These are all have the same content format as ASN1_INTEGER
          */