1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00
samba-mirror/lib/crypto/wscript_configure
Emmanuel Dreyfus d5065ed2f4 Prevent clashes between system and Samba SHA functions
Samba provides its own set of SHA function, which would replace
libc-provided flavors. This is a problem because while the prototypes
are the same, the context structure are different. As a result,
when connecting to a LDAP/SSL directory, we go through
libldap/libssl/libcrypto and there libcrypto expects to call libc
SHA functions, not Samba's.

The fix is to check for SHA function presence and rename Samba's
version to avoid a clash.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo <simo@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun  3 01:54:24 CEST 2015 on sn-devel-104
2015-06-03 01:54:23 +02:00

16 lines
621 B
Plaintext

if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
checklibc=True):
conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
checklibc=True)
conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
checklibc=True)
conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h',
checklibc=True)
if conf.CHECK_FUNCS('SHA1_Update'):
conf.DEFINE('SHA1_RENAME_NEEDED', 1)
if conf.CHECK_FUNCS('SHA256_Update'):
conf.DEFINE('SHA256_RENAME_NEEDED', 1)
if conf.CHECK_FUNCS('SHA512_Update'):
conf.DEFINE('SHA512_RENAME_NEEDED', 1)