lib:crypto: Do not build AES-CMAC if we use GnuTLS that supports it
authorAndreas Schneider <asn@samba.org>
Fri, 15 Mar 2019 13:54:13 +0000 (14:54 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 21 Aug 2019 11:14:11 +0000 (11:14 +0000)
This requires GnuTLS >= 3.6.5.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Aug 21 11:14:11 UTC 2019 on sn-devel-184

lib/crypto/wscript_build
source4/torture/local/local.c

index dcac8fcd30c38789d31571e824f3e78ed3217e7e..4f1665a7fd9099ada2fb0a7130b57703fa3c6be0 100644 (file)
@@ -26,7 +26,8 @@ bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES',
 
 bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES_CMAC',
                     source='aes_cmac_128.c',
-                    deps='talloc')
+                    deps='talloc',
+                    enabled=not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
 
 bld.SAMBA_SUBSYSTEM('LIBCRYPTO',
         source='''
@@ -53,7 +54,8 @@ bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_GCM',
 bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_CMAC',
                     source='aes_cmac_128_test.c',
                     autoproto='aes_cmac_test_proto.h',
-                    deps='talloc')
+                    deps='talloc',
+                    enabled=not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
 
 bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO',
         source='md4test.c',
index 22353d4e1cd0f26d0b90de591bd5c970421614b1..86c537a92270ac39a673f7b1a536ea05e3b5a951 100644 (file)
@@ -25,7 +25,9 @@
 #include "../lib/crypto/test_proto.h"
 #include "../lib/crypto/aes_ccm_test_proto.h"
 #include "../lib/crypto/aes_gcm_test_proto.h"
+#ifndef HAVE_GNUTLS_AES_CMAC
 #include "../lib/crypto/aes_cmac_test_proto.h"
+#endif
 #include "lib/registry/tests/proto.h"
 #include "lib/replace/replace-testsuite.h"
 
@@ -95,8 +97,10 @@ NTSTATUS torture_local_init(TALLOC_CTX *ctx)
        
        torture_suite_add_simple_test(suite, 
                                      "crypto.md4", torture_local_crypto_md4);
+#ifndef HAVE_GNUTLS_AES_CMAC
        torture_suite_add_simple_test(suite, "crypto.aes_cmac_128",
                                      torture_local_crypto_aes_cmac_128);
+#endif
        torture_suite_add_simple_test(suite, "crypto.aes_ccm_128",
                                      torture_local_crypto_aes_ccm_128);
        torture_suite_add_simple_test(suite, "crypto.aes_gcm_128",