diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-02-06 17:47:25 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-02-07 01:11:08 +0100 |
commit | 8443e15eee28603bf427abc03ac1a8d86d23b12a (patch) | |
tree | 0d8e9b29d6e6ae6d15ed905032e5836ff26c5c19 /lib | |
parent | 634f8276dd85872aa2d4f90b5f7b37c56ca5aff9 (diff) | |
download | samba-8443e15eee28603bf427abc03ac1a8d86d23b12a.tar.gz samba-8443e15eee28603bf427abc03ac1a8d86d23b12a.tar.bz2 samba-8443e15eee28603bf427abc03ac1a8d86d23b12a.zip |
crypto: Use libbsd md5 header, if available.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypto/md5.h | 6 | ||||
-rw-r--r-- | lib/crypto/wscript_build | 11 | ||||
-rw-r--r-- | lib/crypto/wscript_configure | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/lib/crypto/md5.h b/lib/crypto/md5.h index e61c27a73e..bcdf50c000 100644 --- a/lib/crypto/md5.h +++ b/lib/crypto/md5.h @@ -1,10 +1,15 @@ #ifndef MD5_H #define MD5_H + #ifndef HEADER_MD5_H /* Try to avoid clashes with OpenSSL */ #define HEADER_MD5_H #endif +#ifdef HAVE_BSD_MD5_H +/* Try to avoid clashes with BSD MD5 implementation */ +#include <bsd/md5.h> +#else typedef struct MD5Context { uint32_t buf[4]; uint32_t bits[2]; @@ -17,5 +22,6 @@ void MD5Init(MD5_CTX *context); void MD5Update(MD5_CTX *context, const uint8_t *buf, size_t len); void MD5Final(uint8_t digest[MD5_DIGEST_LENGTH], MD5_CTX *context); +#endif /* HAVE_BSD_MD5_H */ #endif /* !MD5_H */ diff --git a/lib/crypto/wscript_build b/lib/crypto/wscript_build index 7bc4eb7dd0..6ad1cade98 100644 --- a/lib/crypto/wscript_build +++ b/lib/crypto/wscript_build @@ -1,8 +1,15 @@ #!/usr/bin/env python +extra_source = '' +extra_deps = '' +if bld.CONFIG_SET('HAVE_BSD_MD5_H'): + extra_deps += ' bsd' +else: + extra_source += ' md5.c' + bld.SAMBA_SUBSYSTEM('LIBCRYPTO', - source='crc32.c md5.c hmacmd5.c md4.c arcfour.c sha256.c hmacsha256.c aes.c rijndael-alg-fst.c', - deps='talloc' + source='crc32.c hmacmd5.c md4.c arcfour.c sha256.c hmacsha256.c aes.c rijndael-alg-fst.c' + extra_source, + deps='talloc' + extra_deps ) diff --git a/lib/crypto/wscript_configure b/lib/crypto/wscript_configure new file mode 100644 index 0000000000..77d21e9795 --- /dev/null +++ b/lib/crypto/wscript_configure @@ -0,0 +1,2 @@ +conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h', + checklibc=True) |