]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
nettle 2.7 is required
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 13 Apr 2013 11:35:26 +0000 (13:35 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 13 Apr 2013 11:35:26 +0000 (13:35 +0200)
lib/algorithms/mac.c
lib/nettle/cipher.c
lib/nettle/mac.c
m4/hooks.m4

index e33c8263818514650466316b82ee92aed0d8ec89..81e038acdf10a9108e341d53ff8d36f7bb51152b 100644 (file)
@@ -45,9 +45,7 @@ static const gnutls_hash_entry hash_algorithms[] = {
   {"SHA384", HASH_OID_SHA384, GNUTLS_MAC_SHA384, 48, 48, 0, 0, 1},
   {"SHA512", HASH_OID_SHA512, GNUTLS_MAC_SHA512, 64, 64, 0, 0, 1},
   {"SHA224", HASH_OID_SHA224, GNUTLS_MAC_SHA224, 28, 28, 0, 0, 1},
-#ifdef HAVE_NETTLE27
   {"UMAC-96", NULL, GNUTLS_MAC_UMAC_96, 12, 16, 8, 0, 1},
-#endif
   {"AEAD", NULL, GNUTLS_MAC_AEAD, 0, 0, 0, 1, 1},
   {"MD2", HASH_OID_MD2, GNUTLS_MAC_MD2, 0, 0, 0, 0, 0},     /* not used as MAC */
   {"RIPEMD160", HASH_OID_RMD160, GNUTLS_MAC_RMD160, 20, 20, 0, 0, 1},
index ccfe87b80644c3f31ed2150d873e15ede461926c..57aa15901a04bad4724d5a9a27ce69bdd0c07506 100644 (file)
@@ -119,9 +119,7 @@ static int wrap_nettle_cipher_exists(gnutls_cipher_algorithm_t algo)
     case GNUTLS_CIPHER_DES_CBC:
     case GNUTLS_CIPHER_ARCFOUR_128:
     case GNUTLS_CIPHER_SALSA20_256:
-#ifdef HAVE_NETTLE27
     case GNUTLS_CIPHER_ESTREAM_SALSA20_256:
-#endif
     case GNUTLS_CIPHER_ARCFOUR_40:
     case GNUTLS_CIPHER_RC2_40_CBC:
       return 1;
@@ -210,7 +208,6 @@ wrap_nettle_cipher_init (gnutls_cipher_algorithm_t algo, void **_ctx, int enc)
       ctx->ctx_ptr = &ctx->ctx.salsa20;
       ctx->block_size = 1;
       break;
-#ifdef HAVE_NETTLE27
     case GNUTLS_CIPHER_ESTREAM_SALSA20_256:
       ctx->encrypt = stream_encrypt;
       ctx->decrypt = stream_encrypt;
@@ -219,7 +216,6 @@ wrap_nettle_cipher_init (gnutls_cipher_algorithm_t algo, void **_ctx, int enc)
       ctx->ctx_ptr = &ctx->ctx.salsa20;
       ctx->block_size = 1;
       break;
-#endif
     case GNUTLS_CIPHER_RC2_40_CBC:
       ctx->encrypt = cbc_encrypt;
       ctx->decrypt = cbc_decrypt;
index 856ff5a75efa97298e07a8b3c6e9eb1e63a6c131..6a52e5917c3b178fca2cdac50267fae46a373114 100644 (file)
@@ -30,9 +30,7 @@
 #include <nettle/md2.h>
 #include <nettle/sha.h>
 #include <nettle/hmac.h>
-#ifdef HAVE_NETTLE27
-# include <nettle/umac.h>
-#endif
+#include <nettle/umac.h>
 
 typedef void (*update_func) (void *, unsigned, const uint8_t *);
 typedef void (*digest_func) (void *, unsigned, uint8_t *);
@@ -70,9 +68,7 @@ struct nettle_mac_ctx
     struct hmac_sha384_ctx sha384;
     struct hmac_sha512_ctx sha512;
     struct hmac_sha1_ctx sha1;
-#ifdef HAVE_NETTLE27
     struct umac96_ctx umac;
-#endif
   } ctx;
   
   /* this is the context just after
@@ -86,9 +82,7 @@ struct nettle_mac_ctx
     struct hmac_sha384_ctx sha384;
     struct hmac_sha512_ctx sha512;
     struct hmac_sha1_ctx sha1;
-#ifdef HAVE_NETTLE27
     struct umac96_ctx umac;
-#endif
   } init_ctx;
   void *ctx_ptr;
   gnutls_mac_algorithm_t algo;
@@ -99,13 +93,11 @@ struct nettle_mac_ctx
   set_nonce_func set_nonce;
 };
 
-#ifdef HAVE_NETTLE27
 static void
 _wrap_umac96_set_key(void* ctx, unsigned len, const uint8_t* key)
 {
        return umac96_set_key(ctx, key);
 }
-#endif
 
 static int _mac_ctx_init(gnutls_mac_algorithm_t algo, struct nettle_mac_ctx *ctx)
 {
@@ -154,7 +146,6 @@ static int _mac_ctx_init(gnutls_mac_algorithm_t algo, struct nettle_mac_ctx *ctx
       ctx->ctx_ptr = &ctx->ctx.sha512;
       ctx->length = SHA512_DIGEST_SIZE;
       break;
-#ifdef HAVE_NETTLE27
     case GNUTLS_MAC_UMAC_96:
       ctx->update = (update_func) umac96_update;
       ctx->digest = (digest_func) umac96_digest;
@@ -163,7 +154,6 @@ static int _mac_ctx_init(gnutls_mac_algorithm_t algo, struct nettle_mac_ctx *ctx
       ctx->ctx_ptr = &ctx->ctx.umac;
       ctx->length = 12;
       break;
-#endif
     default:
       gnutls_assert ();
       return GNUTLS_E_INVALID_REQUEST;
@@ -204,9 +194,7 @@ static int wrap_nettle_mac_exists(gnutls_mac_algorithm_t algo)
     case GNUTLS_MAC_SHA256:
     case GNUTLS_MAC_SHA384:
     case GNUTLS_MAC_SHA512:
-#ifdef HAVE_NETTLE27
     case GNUTLS_MAC_UMAC_96:
-#endif
       return 1;
     default:
       return 0;
index 725acf03bfd7c8a689a0a78d2d772a906a0ae7b0..7012149a5d6e4cd9b1c44c40757cb901b0f4ed59 100644 (file)
@@ -89,12 +89,12 @@ dnl    fi
   AC_MSG_CHECKING([whether to use nettle])
 if test "$cryptolib" = "nettle";then
   AC_MSG_RESULT(yes)
-    AC_LIB_HAVE_LINKFLAGS([nettle], [hogweed gmp], [#include <nettle/rsa.h>],
-                          [rsa_decrypt_tr (0,0,0,0,0,0,0)])
+    AC_LIB_HAVE_LINKFLAGS([nettle], [hogweed gmp], [#include <nettle/umac.h>],
+                          [nettle_umac96_set_nonce (0,0,0)])
     if test "$ac_cv_libnettle" != yes; then
       AC_MSG_ERROR([[
   *** 
-  *** Libnettle 2.5 was not found. Note that you must compile nettle with gmp support.
+  *** Libnettle 2.7 was not found. Note that you must compile nettle with gmp support.
   ]])
     fi
 else
@@ -102,8 +102,6 @@ else
 fi
   AM_CONDITIONAL(ENABLE_NETTLE, test "$cryptolib" = "nettle")
   
-  AC_CHECK_LIB([nettle], [nettle_umac96_set_nonce], [AC_DEFINE([HAVE_NETTLE27], [], [UMAC detected in nettle])])
-
   AC_ARG_WITH(included-libtasn1,
     AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]),
       included_libtasn1=$withval,