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