lib:crypto: Prepare not to build AES or AES-CMAC if we use GnuTLS support 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 09:57:31 +0000 (09:57 +0000)
Samba will soon require GnuTLS >= 3.4.7.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Adjusted by Andrew Bartlett from an earlier more comprehensive patch by Andreas

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/crypto/wscript_build
source4/torture/local/local.c

index a26c10b627b708ea9cb12bf13a76fe62fd29385a..9a7c715754dff48cb7115f0aa028b4d2eba5e144 100644 (file)
@@ -20,27 +20,59 @@ bld.SAMBA_SUBSYSTEM('LIBCRYPTO_RC4',
                     deps='talloc',
                     enabled=not bld.CONFIG_SET('HAVE_GNUTLS_3_4_7'))
 
+bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES_CCM',
+                    source='aes_ccm_128.c',
+                    deps='talloc')
+
+bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES_GCM',
+                    source='aes_gcm_128.c',
+                    deps='talloc')
+
+bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES',
+                    source='aes.c rijndael-alg-fst.c',
+                    deps='talloc')
+
+bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES_CMAC',
+                    source='aes_cmac_128.c',
+                    deps='talloc')
+
 bld.SAMBA_SUBSYSTEM('LIBCRYPTO',
         source='''
                md4.c
-               aes.c
-               rijndael-alg-fst.c
-               aes_cmac_128.c
-               aes_ccm_128.c
-               aes_gcm_128.c
                ''',
         deps='''
              talloc
              LIBCRYPTO_RC4
+             LIBCRYPTO_AES
+             LIBCRYPTO_AES_CCM
+             LIBCRYPTO_AES_GCM
+             LIBCRYPTO_AES_CMAC
              ''' + extra_deps)
 
+bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_CCM',
+                    source='aes_ccm_128_test.c',
+                    autoproto='aes_ccm_test_proto.h',
+                    deps='talloc')
+
+bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_GCM',
+                    source='aes_gcm_128_test.c',
+                    autoproto='aes_gcm_test_proto.h',
+                    deps='talloc')
+
+bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_CMAC',
+                    source='aes_cmac_128_test.c',
+                    autoproto='aes_cmac_test_proto.h',
+                    deps='talloc')
+
 bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO',
-        source='''md4test.c
-            aes_cmac_128_test.c aes_ccm_128_test.c aes_gcm_128_test.c
-        ''',
+        source='md4test.c',
         autoproto='test_proto.h',
-        deps='LIBCRYPTO'
-        )
+        deps='''
+             LIBCRYPTO
+             TORTURE_LIBCRYPTO_AES_CCM
+             TORTURE_LIBCRYPTO_AES_GCM
+             TORTURE_LIBCRYPTO_AES_CMAC
+             ''')
 
 bld.SAMBA_PYTHON('python_crypto',
                  source='py_crypto.c',
index 0403e14697b20c6f2a92e38b44be5ee3fdd8e354..22353d4e1cd0f26d0b90de591bd5c970421614b1 100644 (file)
@@ -23,6 +23,9 @@
 #include "torture/ndr/proto.h"
 #include "torture/auth/proto.h"
 #include "../lib/crypto/test_proto.h"
+#include "../lib/crypto/aes_ccm_test_proto.h"
+#include "../lib/crypto/aes_gcm_test_proto.h"
+#include "../lib/crypto/aes_cmac_test_proto.h"
 #include "lib/registry/tests/proto.h"
 #include "lib/replace/replace-testsuite.h"