]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
botan: Fix build without AES and its modes
authorTobias Brunner <tobias@strongswan.org>
Thu, 25 Oct 2018 12:21:38 +0000 (14:21 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 26 Oct 2018 09:06:45 +0000 (11:06 +0200)
src/libstrongswan/plugins/botan/botan_crypter.c
src/libstrongswan/plugins/botan/botan_plugin.c

index 002be6ea81b7fabb5897fc3b20a005404d2b2e17..3ec5c4d5e4182cf4cbefd738cc08b9a184c9c852 100644 (file)
 
 #include "botan_crypter.h"
 
+#include <botan/build.h>
+
+#if defined(BOTAN_HAS_AES) && defined(BOTAN_HAS_MODE_CBC)
+
 #include <botan/ffi.h>
 
 typedef struct private_botan_crypter_t private_botan_crypter_t;
@@ -189,3 +193,5 @@ botan_crypter_t *botan_crypter_create(encryption_algorithm_t algo,
        this->key = chunk_alloc(key_size);
        return &this->public;
 }
+
+#endif
index 205e30dc9f1d713da8eecb02be56631a49ef630f..fbdc877f10833e3f2a6c4a5a66682ba779467b87 100644 (file)
@@ -103,6 +103,7 @@ METHOD(plugin_t, get_features, int,
 #endif
 
                /* crypters */
+#if defined(BOTAN_HAS_AES) && defined(BOTAN_HAS_MODE_CBC)
                PLUGIN_REGISTER(CRYPTER, botan_crypter_create),
 #ifdef BOTAN_HAS_AES
        #ifdef BOTAN_HAS_MODE_CBC
@@ -110,9 +111,13 @@ METHOD(plugin_t, get_features, int,
                        PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 24),
                        PLUGIN_PROVIDE(CRYPTER, ENCR_AES_CBC, 32),
        #endif
+#endif
 #endif
 
                /* AEAD */
+#if (defined(BOTAN_HAS_AES) && \
+               (defined(BOTAN_HAS_AEAD_GCM) || defined(BOTAN_HAS_AEAD_CCM))) || \
+       defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
                PLUGIN_REGISTER(AEAD, botan_aead_create),
 #ifdef BOTAN_HAS_AES
        #ifdef BOTAN_HAS_AEAD_GCM
@@ -140,6 +145,7 @@ METHOD(plugin_t, get_features, int,
 #endif
 #ifdef BOTAN_HAS_AEAD_CHACHA20_POLY1305
                        PLUGIN_PROVIDE(AEAD, ENCR_CHACHA20_POLY1305, 32),
+#endif
 #endif
 
                /* hashers */