1524bc
From 2d058fe332a9aae11607a86c349aee33fa580542 Mon Sep 17 00:00:00 2001
1524bc
From: Andreas Schneider <asn@samba.org>
1524bc
Date: Tue, 10 Dec 2019 18:06:29 +0100
1524bc
Subject: [PATCH 191/191] lib:crypto: Build intel aes-ni only if GnuTLS doesn't
1524bc
 provide AES CMAC
1524bc
1524bc
Signed-off-by: Andreas Schneider <asn@samba.org>
1524bc
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
1524bc
1524bc
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
1524bc
Autobuild-Date(master): Tue Dec 10 20:30:57 UTC 2019 on sn-devel-184
1524bc
1524bc
(cherry picked from commit 20b9cae63d5a5881cc6100a2533fab683cc307aa)
1524bc
---
1524bc
 lib/crypto/wscript_build        | 3 ++-
1524bc
 third_party/aesni-intel/wscript | 3 ++-
1524bc
 2 files changed, 4 insertions(+), 2 deletions(-)
1524bc
1524bc
diff --git a/lib/crypto/wscript_build b/lib/crypto/wscript_build
1524bc
index 46ae5e9ba80..eb67af63f26 100644
1524bc
--- a/lib/crypto/wscript_build
1524bc
+++ b/lib/crypto/wscript_build
1524bc
@@ -2,7 +2,8 @@
1524bc
 
1524bc
 extra_deps = ''
1524bc
 
1524bc
-if bld.CONFIG_SET("HAVE_AESNI_INTEL"):
1524bc
+if (bld.CONFIG_SET("HAVE_AESNI_INTEL") and
1524bc
+    not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC')):
1524bc
         extra_deps += ' aesni-intel'
1524bc
 
1524bc
 bld.SAMBA_SUBSYSTEM('GNUTLS_HELPERS',
1524bc
diff --git a/third_party/aesni-intel/wscript b/third_party/aesni-intel/wscript
1524bc
index 955b5162140..382b3c6a7ff 100644
1524bc
--- a/third_party/aesni-intel/wscript
1524bc
+++ b/third_party/aesni-intel/wscript
1524bc
@@ -21,7 +21,8 @@ def configure(conf):
1524bc
             raise Errors.WafError('--accel-aes=intelaesni selected and linker rejects -z noexecstack')
1524bc
 
1524bc
 def build(bld):
1524bc
-    if not bld.CONFIG_SET('HAVE_AESNI_INTEL'):
1524bc
+    if (not bld.CONFIG_SET('HAVE_AESNI_INTEL') or
1524bc
+        bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC')):
1524bc
         return
1524bc
 
1524bc
     bld.SAMBA_LIBRARY('aesni-intel',
1524bc
-- 
1524bc
2.23.0
1524bc