Support Nettle 2.4 crypto backend (for ripemd160).
authorMilan Broz <gmazyland@gmail.com>
Wed, 5 Oct 2011 08:33:33 +0000 (08:33 +0000)
committerMilan Broz <gmazyland@gmail.com>
Wed, 5 Oct 2011 08:33:33 +0000 (08:33 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@613 36d66b0a-2a48-0410-832c-cd162a569da5

ChangeLog
configure.in
lib/crypto_backend/crypto_nettle.c

index 9dddfeb..f0e8e1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2011-10-05  Milan Broz  <mbroz@redhat.com>
+       * Support Nettle 2.4 crypto backend (for ripemd160).
+
 2011-09-22  Milan Broz  <mbroz@redhat.com>
        * Support key-slot option for luksOpen (use only explicit keyslot).
 
index 8fa8df2..4aaeaa9 100644 (file)
@@ -124,13 +124,11 @@ AC_DEFUN([CONFIGURE_NETTLE], [
                [AC_MSG_ERROR('You need Nettle cryptographic library.')])
 
        saved_LIBS=$LIBS
-       AC_CHECK_LIB(nettle, nettle_sha512_init,,
-               [AC_MSG_ERROR('You need Nettle library version 2.1 or more recent.')])
+       AC_CHECK_LIB(nettle, nettle_ripemd160_init,,
+               [AC_MSG_ERROR('You need Nettle library version 2.4 or more recent.')])
        CRYPTO_LIBS=$LIBS
        LIBS=$saved_LIBS
 
-       AC_MSG_WARN([Nettle backend does NOT provide backward compatibility (missing ripemd160 hash).])
-
        CRYPTO_STATIC_LIBS=$CRYPTO_LIBS
 ])
 
index b8d000b..9e736f0 100644 (file)
@@ -81,6 +81,14 @@ static struct hash_alg hash_algs[] = {
                (digest_func) hmac_sha512_digest,
                (set_key_func) hmac_sha512_set_key,
        },
+       { "ripemd160", RIPEMD160_DIGEST_SIZE,
+               (init_func) ripemd160_init,
+               (update_func) ripemd160_update,
+               (digest_func) ripemd160_digest,
+               (update_func) hmac_ripemd160_update,
+               (digest_func) hmac_ripemd160_digest,
+               (set_key_func) hmac_ripemd160_set_key,
+       },
        { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, }
 };