]> granicus.if.org Git - curl/commitdiff
openssl: enable PKCS12 support for !BoringSSL
authorDaniel Stenberg <daniel@haxx.se>
Thu, 5 Oct 2017 08:16:40 +0000 (10:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 Oct 2017 09:29:53 +0000 (11:29 +0200)
Enable PKCS12 for all non-boringssl builds without relying on configure
or cmake checks.

Bug: https://curl.haxx.se/mail/lib-2017-10/0007.html
Reported-by: Christian Schmitz
Closes #1948

CMakeLists.txt
configure.ac
lib/vtls/openssl.c

index 261baba5c50ca03acaa6efa26bd07e772454fb5e..3bfb5febdc17d3cabc3d8d93f1bd35c85d8381b6 100644 (file)
@@ -366,7 +366,6 @@ if(CMAKE_USE_OPENSSL)
   check_include_file("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
   check_include_file("openssl/err.h"    HAVE_OPENSSL_ERR_H)
   check_include_file("openssl/pem.h"    HAVE_OPENSSL_PEM_H)
-  check_include_file("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
   check_include_file("openssl/rsa.h"    HAVE_OPENSSL_RSA_H)
   check_include_file("openssl/ssl.h"    HAVE_OPENSSL_SSL_H)
   check_include_file("openssl/x509.h"   HAVE_OPENSSL_X509_H)
index 56b8756ba222c1b5c5cfbc162eb000e266b2d8b3..8d71bb6fcae06092cdd77f5a66c20eecd96730f5 100755 (executable)
@@ -1647,10 +1647,7 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
       fi
     fi
 
-    if test X"$OPENSSL_ENABLED" = X"1"; then
-       dnl is there a pkcs12.h header present?
-       AC_CHECK_HEADERS(openssl/pkcs12.h)
-    else
+    if test X"$OPENSSL_ENABLED" != X"1"; then
        LIBS="$CLEANLIBS"
     fi
 
index 7b41353d00fd6b3892f60543674b5394ce08918d..2ee27d5b5a746561165bbd9131f89057e3882291 100644 (file)
@@ -69,7 +69,9 @@
 #include <openssl/bio.h>
 #include <openssl/buffer.h>
 
-#ifdef HAVE_OPENSSL_PKCS12_H
+#ifndef OPENSSL_IS_BORINGSSL
+/* BoringSSL does not support PKCS12 */
+#define HAVE_PKCS12_SUPPORT 1
 #include <openssl/pkcs12.h>
 #endif
 
@@ -653,7 +655,7 @@ int cert_stuff(struct connectdata *conn,
 
     case SSL_FILETYPE_PKCS12:
     {
-#ifdef HAVE_OPENSSL_PKCS12_H
+#ifdef HAVE_PKCS12_SUPPORT
       FILE *f;
       PKCS12 *p12;
       EVP_PKEY *pri;