CVE-2023-3961:s3: smbd: Remove the SMB_ASSERT() that crashes on bad pipenames.
[Samba.git] / lib / crypto / wscript
blobacf5cb8e7315aab031047195b8a067581c4b98db
1 #!/usr/bin/env python
2 from waflib import Options
3 from waflib import Errors, Logs
6 def options(opt):
7 opt.add_option('--accel-aes',
8 help=("Should we use accelerated AES crypto functions. "
9 "Options are intelaesni|none."),
10 action="store",
11 dest='accel_aes',
12 default="none")
15 def configure(conf):
16 if conf.CHECK_FUNCS('SHA1_Update'):
17 conf.DEFINE('SHA1_RENAME_NEEDED', 1)
20 # --aes-accel=XXX selects accelerated AES crypto library to use, if any.
21 # Default is none.
23 if Options.options.accel_aes.lower() == "intelaesni":
24 Logs.info("Attempting to compile with runtime-switchable x86_64 "
25 "Intel AES instructions. WARNING - this is temporary.")
26 elif Options.options.accel_aes.lower() != "none":
27 raise Errors.WafError("--aes-accel=%s is not a valid option. Valid "
28 "options are [none|intelaesni]" %
29 Options.options.accel_aes)
32 def build(bld):
33 extra_deps = ""
35 if (bld.CONFIG_SET("HAVE_AESNI_INTEL")
36 and not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC')):
37 extra_deps += ' aesni-intel'
39 bld.SAMBA_SUBSYSTEM("GNUTLS_HELPERS",
40 source='''
41 gnutls_error.c
42 gnutls_aead_aes_256_cbc_hmac_sha512.c
43 gnutls_arcfour_confounded_md5.c
44 gnutls_weak_crypto.c
45 ''',
46 deps="gnutls samba-errors")
48 bld.SAMBA_SUBSYSTEM("LIBCRYPTO_AES",
49 source='aes.c rijndael-alg-fst.c',
50 deps='talloc',
51 enabled=not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
53 bld.SAMBA_SUBSYSTEM('LIBCRYPTO_AES_CMAC',
54 source='aes_cmac_128.c',
55 deps='talloc',
56 enabled=not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
58 bld.SAMBA_SUBSYSTEM('LIBCRYPTO',
59 source='''
60 md4.c
61 ''',
62 deps='''
63 talloc
64 LIBCRYPTO_AES
65 LIBCRYPTO_AES_CMAC
66 ''' + extra_deps)
68 bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_CMAC',
69 source='aes_cmac_128_test.c',
70 autoproto='aes_cmac_test_proto.h',
71 deps='talloc',
72 enabled=not bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
74 bld.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO',
75 source='md4test.c',
76 autoproto='test_proto.h',
77 deps='''
78 LIBCRYPTO
79 TORTURE_LIBCRYPTO_AES_CMAC
80 ''')
82 bld.SAMBA_PYTHON('python_crypto',
83 source='py_crypto.c',
84 deps='gnutls talloc LIBCLI_AUTH',
85 realname='samba/crypto.so')
87 bld.SAMBA_BINARY('test_gnutls_aead_aes_256_cbc_hmac_sha512',
88 source='''
89 gnutls_error.c
90 tests/test_gnutls_aead_aes_256_cbc_hmac_sha512.c
91 ''',
92 deps='cmocka gnutls samba-util samba-errors',
93 local_include=False,
94 for_selftest=True)