Blob Blame History Raw
From 5c7eee2facbfc51078ecbdfcfe895a1215e56029 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Fri, 15 Mar 2019 14:54:13 +0100
Subject: [PATCH 123/187] lib:crypto: Do not build AES-CMAC if we use GnuTLS
 that supports it

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

(cherry picked from commit c3f969817553dc9c9db88741bad51100b4d24604)
---
 lib/crypto/wscript_build      | 6 ++++--
 source4/torture/local/local.c | 4 ++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/crypto/wscript_build b/lib/crypto/wscript_build
index dcac8fcd30c..4f1665a7fd9 100644
--- a/lib/crypto/wscript_build
+++ b/lib/crypto/wscript_build
@@ -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',
diff --git a/source4/torture/local/local.c b/source4/torture/local/local.c
index fa4061c108b..5812f4dd20c 100644
--- a/source4/torture/local/local.c
+++ b/source4/torture/local/local.c
@@ -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"
 
@@ -94,8 +96,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",
-- 
2.23.0