]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
support older gcrypt libraries not defining the CAMELLIA cipher
authorMartin Willi <martin@strongswan.org>
Tue, 16 Jun 2009 12:23:32 +0000 (14:23 +0200)
committerMartin Willi <martin@strongswan.org>
Tue, 16 Jun 2009 12:23:32 +0000 (14:23 +0200)
configure.in
src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c

index 4c366b7797ed82fdb46c0d5b6a4aadab0f5911a2..db61ae46d13231bbfa40aafb4a20b828a0267fe6 100644 (file)
@@ -1015,6 +1015,13 @@ fi
 
 if test x$gcrypt = xtrue; then
        AM_PATH_LIBGCRYPT(,,[AC_MSG_ERROR([libgcrypt not found!])])
+       AC_MSG_CHECKING([gcrypt CAMELLIA cipher])
+       AC_TRY_COMPILE(
+               [#include <gcrypt.h>],
+               [enum gcry_cipher_algos alg = GCRY_CIPHER_CAMELLIA128;],
+               [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GCRY_CIPHER_CAMELLIA])],
+               [AC_MSG_RESULT([no])]
+       )
 fi
 
 if test x$uci = xtrue; then
index 17e6ef26fe1d1b4ca396fc146f10910003d691b8..f82d2318528833fd7a9938d206c4f80269ec3c54 100644 (file)
@@ -180,6 +180,7 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo,
                case ENCR_CAMELLIA_CBC:
                        switch (key_size)
                        {
+#ifdef HAVE_GCRY_CIPHER_CAMELLIA
                                case 16:
                                        gcrypt_alg = GCRY_CIPHER_CAMELLIA128;
                                        break;
@@ -189,6 +190,7 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo,
                                case 32:
                                        gcrypt_alg = GCRY_CIPHER_CAMELLIA256;
                                        break;
+#endif /* HAVE_GCRY_CIPHER_CAMELLIA */
                                default:
                                        return NULL;
                        }