Fail when parsing unsupported critical extensions in openssl_x509
authorMartin Willi <martin@revosec.ch>
Tue, 14 Dec 2010 16:34:34 +0000 (17:34 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 5 Jan 2011 15:46:02 +0000 (16:46 +0100)
src/libstrongswan/plugins/openssl/openssl_x509.c

index 80639dd..80e421a 100644 (file)
@@ -841,7 +841,11 @@ static bool parse_extensions(private_openssl_x509_t *this)
                                        ok = parse_crlDistributionPoints_ext(this, ext);
                                        break;
                                default:
-                                       ok = TRUE;
+                                       ok = X509_EXTENSION_get_critical(ext) != 0;
+                                       if (!ok)
+                                       {
+                                               DBG1(DBG_LIB, "found unsupported critical X.509 extension");
+                                       }
                                        break;
                        }
                        if (!ok)