md5, sha1, sha256, sha512: use openssl routines if available
authorPádraig Brady <P@draigBrady.com>
Sat, 30 Nov 2013 05:19:32 +0000 (05:19 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 3 Dec 2013 03:21:00 +0000 (03:21 +0000)
commit8e0f64e4cd12f7779113bc438afd106dad3e1f1a
tree579a3bf429849766cb20e6f43d5326cc09512980
parentdbf55f6694dbf710b44e3ae76a46fd8b8f993f7c
md5, sha1, sha256, sha512: use openssl routines if available

--with-openssl the libcrypto md5, sha1, sha224, sha256, sha384, sha256
routines will be used if available, requiring apps to link @LIB_CRYPTO@

* lib/gl_openssl.h: Provide wrappers for specified openssl hash.
* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): New function to lookup libcrypto
in the standard system location.
* m4/sha1.m4: Call gl_CRYPTO_CHECK() for SHA1.
* m4/sha256.m4: Likewise with SHA256.
* m4/sha512.m4: Likewise with SHA512.
* m4/md5.m4: Likewise with MD5.
* m4/gc.m4: Ensure @LIB_CRYPTO@ set for tests.
* lib/sha1.h: Include wrappers if HAVE_OPENSSL_SHA1.
* lib/sha256.h: Likewise with SHA256.
* lib/sha512.h: Likewise with SHA512.
* lib/md5.h: Likewise with MD5.
* lib/sha1.c: Exlude functionality if HAVE_OPENSSL_SHA1.
* lib/sha256.c: Likewise with SHA256.
* lib/sha512.c: Likewise with SHA512.
* lib/md5.c: Likewise with MD5.
* modules/crypto/sha1 (Link:): Add the new optional lib.
(Depends-on:): Add dependency on extern-inline.
* modules/crypto/sha256: Likewise.
* modules/crypto/sha512: Likewise.
* modules/crypto/md5: Likewise.
* modules/crypto/sha1-tests: Reference the lib here too.
* modules/crypto/md5-tests: Likewise.
* modules/crypto/gc-des-tests: Likewise.
* modules/crypto/gc-hmac-md5-tests: Likewise.
* modules/crypto/gc-hmac-sha1-tests: Likewise.
* modules/crypto/gc-hmac-sha256-tests: Likewise.
* modules/crypto/gc-hmac-sha512-tests: Likewise.
* modules/crypto/gc-md5-tests: Likewise.
* modules/crypto/gc-pbkdf2-sha1-tests: Likewise.
* modules/crypto/gc-sha1-tests: Likewise.
* modules/crypto/gc-tests: Likewise.
* modules/crypto/hmac-md5-tests: Likewise.
* modules/crypto/hmac-sha1-tests: Likewise.
* modules/crypto/hmac-sha256-tests: Likewise.
* modules/crypto/hmac-sha512-tests: Likewise.
35 files changed:
ChangeLog
lib/gl_openssl.h [new file with mode: 0644]
lib/md5.c
lib/md5.h
lib/sha1.c
lib/sha1.h
lib/sha256.c
lib/sha256.h
lib/sha512.c
lib/sha512.h
m4/gc.m4
m4/gl-openssl.m4 [new file with mode: 0644]
m4/md5.m4
m4/sha1.m4
m4/sha256.m4
m4/sha512.m4
modules/crypto/gc-des-tests
modules/crypto/gc-hmac-md5-tests
modules/crypto/gc-hmac-sha1-tests
modules/crypto/gc-hmac-sha256-tests
modules/crypto/gc-hmac-sha512-tests
modules/crypto/gc-md5-tests
modules/crypto/gc-pbkdf2-sha1-tests
modules/crypto/gc-sha1-tests
modules/crypto/gc-tests
modules/crypto/hmac-md5-tests
modules/crypto/hmac-sha1-tests
modules/crypto/hmac-sha256-tests
modules/crypto/hmac-sha512-tests
modules/crypto/md5
modules/crypto/md5-tests
modules/crypto/sha1
modules/crypto/sha1-tests
modules/crypto/sha256
modules/crypto/sha512