openssl: Disable PKCS#7/CMS when building against OpenSSL < 0.9.8g
authorTobias Brunner <tobias@strongswan.org>
Tue, 19 Feb 2013 13:12:57 +0000 (14:12 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 20 Feb 2013 17:34:54 +0000 (18:34 +0100)
Fixes #292.

src/libstrongswan/plugins/openssl/openssl_pkcs7.c
src/libstrongswan/plugins/openssl/openssl_plugin.c

index ccc4262..9c3c404 100644 (file)
  * for more details.
  */
 
+#include <openssl/opensslv.h>
 #include <openssl/opensslconf.h>
 
+#if OPENSSL_VERSION_NUMBER >= 0x0090807fL
 #ifndef OPENSSL_NO_CMS
 
 #include "openssl_pkcs7.h"
@@ -788,3 +790,4 @@ pkcs7_t *openssl_pkcs7_load(container_type_t type, va_list args)
 }
 
 #endif /* OPENSSL_NO_CMS */
+#endif /* OPENSSL_VERSION_NUMBER */
index dd6a379..0f5b071 100644 (file)
@@ -366,10 +366,12 @@ METHOD(plugin_t, get_features, int,
                                PLUGIN_SDEPEND(PUBKEY, KEY_DSA),
                PLUGIN_REGISTER(CERT_DECODE, openssl_crl_load, TRUE),
                        PLUGIN_PROVIDE(CERT_DECODE, CERT_X509_CRL),
+#if OPENSSL_VERSION_NUMBER >= 0x0090807fL
 #ifndef OPENSSL_NO_CMS
                PLUGIN_REGISTER(CONTAINER_DECODE, openssl_pkcs7_load, TRUE),
                        PLUGIN_PROVIDE(CONTAINER_DECODE, CONTAINER_PKCS7),
 #endif /* OPENSSL_NO_CMS */
+#endif /* OPENSSL_VERSION_NUMBER */
 #ifndef OPENSSL_NO_ECDH
                /* EC DH groups */
                PLUGIN_REGISTER(DH, openssl_ec_diffie_hellman_create),
@@ -470,4 +472,3 @@ plugin_t *openssl_plugin_create()
 
        return &this->public.plugin;
 }
-