Fix ASN1_TYPE_cmp
authorDr. Stephen Henson <steve@openssl.org>
Mon, 9 Mar 2015 23:11:45 +0000 (23:11 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 19 Mar 2015 13:00:44 +0000 (13:00 +0000)
Fix segmentation violation when ASN1_TYPE_cmp is passed a boolean type. This
can be triggered during certificate verification so could be a DoS attack
against a client or a server enabling client authentication.

CVE-2015-0286

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/asn1/a_type.c

index 00367ad9a0deed381003d08f306d4f73af3573cc..69a5cf6f413e7204812ac3dcf60e4c32bc4ca21b 100644 (file)
@@ -116,6 +116,9 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b)
     case V_ASN1_OBJECT:
         result = OBJ_cmp(a->value.object, b->value.object);
         break;
+    case V_ASN1_BOOLEAN:
+        result = a->value.boolean - b->value.boolean;
+        break;
     case V_ASN1_NULL:
         result = 0;             /* They do not have content. */
         break;