gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-43-gf402f9b


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-43-gf402f9b
Date: Sat, 01 Oct 2011 06:00:34 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=f402f9b2d2358c2a09e8973fcf877c7de71cd308

The branch, master has been updated
       via  f402f9b2d2358c2a09e8973fcf877c7de71cd308 (commit)
       via  d56146522aaf03414a4d69f2c61d9f8845134411 (commit)
       via  228048a83e260e708f7bccaff2eaa637df8a164e (commit)
       via  b9dbbe7dbb6f7091305c340f63c404f116601883 (commit)
      from  2f5d34846c617823e86246466ae54779badfad76 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f402f9b2d2358c2a09e8973fcf877c7de71cd308
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Oct 1 06:41:10 2011 +0200

    The hash_fast() and hmac_fast() functions can be registered as well to allow
    backends with optimized (hw) implementations. In the nettle backend the 
different
    is one memory allocation less.

commit d56146522aaf03414a4d69f2c61d9f8845134411
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 30 16:01:08 2011 +0200

    operations structures were made constants.

commit 228048a83e260e708f7bccaff2eaa637df8a164e
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 30 15:50:55 2011 +0200

    simplified usage of resume_true and resume_false.

commit b9dbbe7dbb6f7091305c340f63c404f116601883
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 30 15:50:18 2011 +0200

    simplified assignment of server_write and client_write.

-----------------------------------------------------------------------

Summary of changes:
 lib/crypto-backend.h    |    6 +-
 lib/gnutls_constate.c   |   18 +++--
 lib/gnutls_handshake.c  |    8 +-
 lib/gnutls_hash_int.c   |   45 +++++++----
 lib/gnutls_int.h        |    8 +-
 lib/gnutls_state.c      |    2 +-
 lib/nettle/mac.c        |   87 +++++++++++++++-----
 libextra/Makefile.am    |    2 +-
 libextra/fipsmd5.c      |  206 -----------------------------------------------
 libextra/gnutls_extra.c |   17 ----
 10 files changed, 120 insertions(+), 279 deletions(-)
 delete mode 100644 libextra/fipsmd5.c

diff --git a/lib/crypto-backend.h b/lib/crypto-backend.h
index 5be0dd9..d0ba265 100644
--- a/lib/crypto-backend.h
+++ b/lib/crypto-backend.h
@@ -51,16 +51,18 @@
     int (*hash) (void *ctx, const void *text, size_t textsize);
     int (*output) (void *src_ctx, void *digest, size_t digestsize);
     void (*deinit) (void *ctx);
+    int (*fast)(gnutls_mac_algorithm_t, const void *key, size_t keysize, const 
void *text, size_t textsize, void *digest);
   } gnutls_crypto_mac_st;
 
   typedef struct
   {
-    int (*init) (gnutls_mac_algorithm_t, void **ctx);
+    int (*init) (gnutls_digest_algorithm_t, void **ctx);
     void (*reset) (void *ctx);
-    int (*hash) (void *ctx, const void *text, size_t textsize);
+    int (*hash) (void *ctx, const void *src, size_t srcsize);
     int (*copy) (void **dst_ctx, void *src_ctx);
     int (*output) (void *src_ctx, void *digest, size_t digestsize);
     void (*deinit) (void *ctx);
+    int (*fast)(gnutls_digest_algorithm_t, const void *src, size_t srcsize, 
void *digest);
   } gnutls_crypto_digest_st;
 
   typedef struct gnutls_crypto_rnd
diff --git a/lib/gnutls_constate.c b/lib/gnutls_constate.c
index 6d25940..f1d7528 100644
--- a/lib/gnutls_constate.c
+++ b/lib/gnutls_constate.c
@@ -71,13 +71,17 @@ _gnutls_set_keys (gnutls_session_t session, 
record_parameters_st * params,
                    2 * MAX_CIPHER_BLOCK_SIZE];
   record_state_st *client_write, *server_write;
 
-  client_write =
-    session->security_parameters.entity ==
-    GNUTLS_CLIENT ? &params->write : &params->read;
-  server_write =
-    session->security_parameters.entity ==
-    GNUTLS_SERVER ? &params->write : &params->read;
-
+  if (session->security_parameters.entity == GNUTLS_CLIENT)
+    {
+      client_write = &params->write;
+      server_write = &params->read;
+    }
+  else
+    {
+      client_write = &params->read;
+      server_write = &params->write;
+    }
+      
   block_size = 2 * hash_size + 2 * key_size;
   if (export_flag == 0)
     block_size += 2 * IV_size;
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 5a4b462..8363bf1 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -552,7 +552,7 @@ _gnutls_read_client_hello (gnutls_session_t session, opaque 
* data,
     }
 
   /* resumed by session_ticket extension */
-  if (session->internals.resumed == RESUME_TRUE)
+  if (session->internals.resumed != RESUME_FALSE)
     {
       /* to indicate the client that the current session is resumed */
       memcpy (session->internals.resumed_security_parameters.session_id,
@@ -643,7 +643,7 @@ _gnutls_send_finished (gnutls_session_t session, int again)
 
       if ((session->internals.resumed == RESUME_FALSE
            && session->security_parameters.entity == GNUTLS_CLIENT)
-          || (session->internals.resumed == RESUME_TRUE
+          || (session->internals.resumed != RESUME_FALSE
               && session->security_parameters.entity == GNUTLS_SERVER))
         {
           /* if we are a client not resuming - or we are a server resuming */
@@ -740,7 +740,7 @@ _gnutls_recv_finished (gnutls_session_t session)
       goto cleanup;
     }
 
-  if ((session->internals.resumed == RESUME_TRUE
+  if ((session->internals.resumed != RESUME_FALSE
        && session->security_parameters.entity == GNUTLS_CLIENT)
       || (session->internals.resumed == RESUME_FALSE
           && session->security_parameters.entity == GNUTLS_SERVER))
@@ -2778,7 +2778,7 @@ _gnutls_handshake_common (gnutls_session_t session)
   int ret = 0;
 
   /* send and recv the change cipher spec and finished messages */
-  if ((session->internals.resumed == RESUME_TRUE
+  if ((session->internals.resumed != RESUME_FALSE
        && session->security_parameters.entity == GNUTLS_CLIENT)
       || (session->internals.resumed == RESUME_FALSE
           && session->security_parameters.entity == GNUTLS_SERVER))
diff --git a/lib/gnutls_hash_int.c b/lib/gnutls_hash_int.c
index 9dd5b09..a6f781a 100644
--- a/lib/gnutls_hash_int.c
+++ b/lib/gnutls_hash_int.c
@@ -145,25 +145,30 @@ int
 _gnutls_hash_fast (gnutls_digest_algorithm_t algorithm,
                    const void *text, size_t textlen, void *digest)
 {
-  digest_hd_st dig;
   int ret;
+  const gnutls_crypto_digest_st *cc = NULL;
 
-  ret = _gnutls_hash_init (&dig, algorithm);
-  if (ret < 0)
+  /* check if a digest has been registered 
+   */
+  cc = _gnutls_get_crypto_digest (algorithm);
+  if (cc != NULL)
     {
-      gnutls_assert ();
-      return ret;
+      if (cc->fast (algorithm, text, textlen, digest) < 0)
+        {
+          gnutls_assert ();
+          return GNUTLS_E_HASH_FAILED;
+        }
+
+      return 0;
     }
 
-  ret = _gnutls_hash (&dig, text, textlen);
+  ret = _gnutls_digest_ops.fast (algorithm, text, textlen, digest);
   if (ret < 0)
     {
       gnutls_assert ();
-      _gnutls_hash_deinit (&dig, NULL);
       return ret;
     }
 
-  _gnutls_hash_deinit (&dig, digest);
   return 0;
 }
 
@@ -174,26 +179,32 @@ int
 _gnutls_hmac_fast (gnutls_mac_algorithm_t algorithm, const void *key,
                    int keylen, const void *text, size_t textlen, void *digest)
 {
-  digest_hd_st dig;
   int ret;
+  const gnutls_crypto_mac_st *cc = NULL;
 
-  ret = _gnutls_hmac_init (&dig, algorithm, key, keylen);
-  if (ret < 0)
+  /* check if a digest has been registered 
+   */
+  cc = _gnutls_get_crypto_mac (algorithm);
+  if (cc != NULL)
     {
-      gnutls_assert ();
-      return ret;
+      if (cc->fast (algorithm, key, keylen, text, textlen, digest) < 0)
+        {
+          gnutls_assert ();
+          return GNUTLS_E_HASH_FAILED;
+        }
+
+      return 0;
     }
 
-  ret = _gnutls_hmac (&dig, text, textlen);
+  ret = _gnutls_mac_ops.fast (algorithm, key, keylen, text, textlen, digest);
   if (ret < 0)
     {
       gnutls_assert ();
-      _gnutls_hmac_deinit (&dig, NULL);
       return ret;
     }
 
-  _gnutls_hmac_deinit (&dig, digest);
   return 0;
+
 }
 
 int
@@ -210,7 +221,7 @@ _gnutls_hmac_init (digest_hd_st * dig, 
gnutls_mac_algorithm_t algorithm,
   /* check if a digest has been registered 
    */
   cc = _gnutls_get_crypto_mac (algorithm);
-  if (cc != NULL)
+  if (cc != NULL && cc->init != NULL)
     {
       if (cc->init (algorithm, &dig->handle) < 0)
         {
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index d47ce59..8e15f4c 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -233,8 +233,8 @@ typedef enum extensions_t
 typedef enum
 { CIPHER_STREAM, CIPHER_BLOCK } cipher_type_t;
 
-#define RESUME_TRUE 0
-#define RESUME_FALSE -1
+#define RESUME_TRUE 1
+#define RESUME_FALSE 0
 
 /* Record Protocol */
 typedef enum content_type_t
@@ -641,7 +641,7 @@ typedef struct
                                                  * the last received message */
   gnutls_buffer_st handshake_hash_buffer;       /* used to keep the last 
received handshake 
                                                  * message */
-  int resumable:1;              /* TRUE or FALSE - if we can resume that 
session */
+  unsigned int resumable:1;              /* TRUE or FALSE - if we can resume 
that session */
   handshake_state_t handshake_state;    /* holds
                                          * a number which indicates where
                                          * the handshake procedure has been
@@ -667,7 +667,7 @@ typedef struct
   struct gnutls_priority_st priorities;
 
   /* resumed session */
-  int resumed:1;                /* RESUME_TRUE or FALSE - if we are resuming a 
session */
+  unsigned int resumed:1;                /* RESUME_TRUE or FALSE - if we are 
resuming a session */
   security_parameters_st resumed_security_parameters;
 
   /* These buffers are used in the handshake
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index 8eda274..3c12508 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -1105,7 +1105,7 @@ gnutls_session_is_resumed (gnutls_session_t session)
     }
   else
     {
-      if (session->internals.resumed == RESUME_TRUE)
+      if (session->internals.resumed != RESUME_FALSE)
         return 1;
     }
 
diff --git a/lib/nettle/mac.c b/lib/nettle/mac.c
index 3be974a..36cded6 100644
--- a/lib/nettle/mac.c
+++ b/lib/nettle/mac.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2008, 2010, 2011 Free Software Foundation, Inc.
  *
  * Author: Nikos Mavrogiannopoulos
  *
@@ -35,7 +35,7 @@ typedef void (*update_func) (void *, unsigned, const uint8_t 
*);
 typedef void (*digest_func) (void *, unsigned, uint8_t *);
 typedef void (*set_key_func) (void *, unsigned, const uint8_t *);
 
-static int wrap_nettle_hash_init (gnutls_mac_algorithm_t algo, void **_ctx);
+static int wrap_nettle_hash_init (gnutls_digest_algorithm_t algo, void **_ctx);
 
 struct nettle_hash_ctx
 {
@@ -83,20 +83,8 @@ struct nettle_hmac_ctx
   size_t key_size;
 };
 
-static int
-wrap_nettle_hmac_init (gnutls_mac_algorithm_t algo, void **_ctx)
+static int _hmac_ctx_init(gnutls_mac_algorithm_t algo, struct nettle_hmac_ctx 
*ctx)
 {
-  struct nettle_hmac_ctx *ctx;
-
-  ctx = gnutls_calloc (1, sizeof (struct nettle_hmac_ctx));
-  if (ctx == NULL)
-    {
-      gnutls_assert ();
-      return GNUTLS_E_MEMORY_ERROR;
-    }
-
-  ctx->algo = algo;
-
   switch (algo)
     {
     case GNUTLS_MAC_MD5:
@@ -145,6 +133,46 @@ wrap_nettle_hmac_init (gnutls_mac_algorithm_t algo, void 
**_ctx)
       gnutls_assert ();
       return GNUTLS_E_INVALID_REQUEST;
     }
+  
+  return 0;
+}
+
+static int wrap_nettle_hmac_fast(gnutls_mac_algorithm_t algo, 
+  const void *key, size_t key_size, const void* text, size_t text_size, 
+  void* digest)
+{
+  struct nettle_hmac_ctx ctx;
+  int ret;
+  
+  ret = _hmac_ctx_init(algo, &ctx);
+  if (ret < 0)
+    return gnutls_assert_val(ret);
+
+  ctx.setkey (&ctx, key_size, key);
+  ctx.update (&ctx, text_size, text);
+  ctx.digest (&ctx, ctx.length, digest);
+  
+  return 0;
+}
+
+static int
+wrap_nettle_hmac_init (gnutls_mac_algorithm_t algo, void **_ctx)
+{
+  struct nettle_hmac_ctx *ctx;
+  int ret;
+
+  ctx = gnutls_calloc (1, sizeof (struct nettle_hmac_ctx));
+  if (ctx == NULL)
+    {
+      gnutls_assert ();
+      return GNUTLS_E_MEMORY_ERROR;
+    }
+
+  ctx->algo = algo;
+
+  ret = _hmac_ctx_init(algo, ctx);
+  if (ret < 0)
+    return gnutls_assert_val(ret);
 
   *_ctx = ctx;
 
@@ -161,7 +189,7 @@ wrap_nettle_hmac_setkey (void *_ctx, const void *key, 
size_t keylen)
 
   ctx->key = gnutls_malloc(keylen);
   if (ctx->key == NULL)
-    return GNUTLS_E_MEMORY_ERROR;
+    return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
 
   memcpy(ctx->key, key, keylen);
   ctx->key_size = keylen;
@@ -237,7 +265,7 @@ wrap_nettle_hash_deinit (void *hd)
   gnutls_free (hd);
 }
 
-static int _ctx_init(struct nettle_hash_ctx *ctx, gnutls_mac_algorithm_t algo)
+static int _ctx_init(gnutls_digest_algorithm_t algo, struct nettle_hash_ctx 
*ctx)
 {
   switch (algo)
     {
@@ -298,8 +326,25 @@ static int _ctx_init(struct nettle_hash_ctx *ctx, 
gnutls_mac_algorithm_t algo)
     return 0;
 }
 
+static int wrap_nettle_hash_fast(gnutls_digest_algorithm_t algo, 
+  const void* text, size_t text_size, 
+  void* digest)
+{
+  struct nettle_hash_ctx ctx;
+  int ret;
+  
+  ret = _ctx_init(algo, &ctx);
+  if (ret < 0)
+    return gnutls_assert_val(ret);
+
+  ctx.update (&ctx, text_size, text);
+  ctx.digest (&ctx, ctx.length, digest);
+  
+  return 0;
+}
+
 static int
-wrap_nettle_hash_init (gnutls_mac_algorithm_t algo, void **_ctx)
+wrap_nettle_hash_init (gnutls_digest_algorithm_t algo, void **_ctx)
 {
   struct nettle_hash_ctx *ctx;
   int ret;
@@ -313,7 +358,7 @@ wrap_nettle_hash_init (gnutls_mac_algorithm_t algo, void 
**_ctx)
 
   ctx->algo = algo;
 
-  if ((ret=_ctx_init( ctx, algo)) < 0)
+  if ((ret=_ctx_init( algo, ctx)) < 0)
     {
       gnutls_assert ();
       return ret;
@@ -347,7 +392,7 @@ wrap_nettle_hash_reset (void *src_ctx)
   struct nettle_hash_ctx *ctx;
   ctx = src_ctx;
 
-  _ctx_init(ctx->ctx_ptr, ctx->algo);
+  _ctx_init(ctx->algo, ctx->ctx_ptr);
 }
 
 static int
@@ -374,6 +419,7 @@ gnutls_crypto_mac_st _gnutls_mac_ops = {
   .reset = wrap_nettle_hmac_reset,
   .output = wrap_nettle_hmac_output,
   .deinit = wrap_nettle_hmac_deinit,
+  .fast = wrap_nettle_hmac_fast,
 };
 
 gnutls_crypto_digest_st _gnutls_digest_ops = {
@@ -383,4 +429,5 @@ gnutls_crypto_digest_st _gnutls_digest_ops = {
   .copy = wrap_nettle_hash_copy,
   .output = wrap_nettle_hash_output,
   .deinit = wrap_nettle_hash_deinit,
+  .fast = wrap_nettle_hash_fast,
 };
diff --git a/libextra/Makefile.am b/libextra/Makefile.am
index 6bfe0b8..31c2a95 100644
--- a/libextra/Makefile.am
+++ b/libextra/Makefile.am
@@ -47,7 +47,7 @@ defexec_DATA =
 
 lib_LTLIBRARIES = libgnutls-extra.la
 
-libgnutls_extra_la_SOURCES = libgnutls-extra.map gnutls_extra.c fipsmd5.c
+libgnutls_extra_la_SOURCES = libgnutls-extra.map gnutls_extra.c
 
 libgnutls_openssl_la_LDFLAGS = -no-undefined
 
diff --git a/libextra/fipsmd5.c b/libextra/fipsmd5.c
deleted file mode 100644
index 801289a..0000000
--- a/libextra/fipsmd5.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2008, 2010 Free Software Foundation, Inc.
- *
- * Author: Simon Josefsson
- *
- * This file is part of GnuTLS-EXTRA.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <gnutls_int.h>
-#include <gnutls/crypto.h>
-#include <gnutls/extra.h>
-
-#include <md5.h>
-#include <hmac.h>
-
-static int
-md5init (gnutls_mac_algorithm_t mac, void **ctx)
-{
-  *ctx = gnutls_malloc (sizeof (struct md5_ctx));
-  if (!*ctx)
-    return GNUTLS_E_MEMORY_ERROR;
-  md5_init_ctx (*ctx);
-  return 0;
-}
-
-static int
-md5hash (void *ctx, const void *text, size_t textsize)
-{
-  md5_process_bytes (text, textsize, ctx);
-  return 0;
-}
-
-static int
-md5copy (void **dst_ctx, void *src_ctx)
-{
-  *dst_ctx = gnutls_malloc (sizeof (struct md5_ctx));
-  if (!*dst_ctx)
-    return GNUTLS_E_MEMORY_ERROR;
-  memcpy (*dst_ctx, src_ctx, sizeof (struct md5_ctx));
-  return 0;
-}
-
-static int
-md5output (void *src_ctx, void *digest, size_t digestsize)
-{
-  char out[MD5_DIGEST_SIZE];
-  md5_finish_ctx (src_ctx, out);
-  memcpy (digest, out, digestsize);
-  return 0;
-}
-
-static void
-md5deinit (void *ctx)
-{
-  gnutls_free (ctx);
-}
-
-struct hmacctx
-{
-  char *data;
-  size_t datasize;
-  char *key;
-  size_t keysize;
-};
-
-static int
-hmacmd5init (gnutls_mac_algorithm_t mac, void **ctx)
-{
-  struct hmacctx *p;
-
-  p = gnutls_malloc (sizeof (struct hmacctx));
-  if (!p)
-    return -1;
-
-  p->data = NULL;
-  p->datasize = 0;
-  p->key = NULL;
-  p->keysize = 0;
-
-  *ctx = p;
-
-  return 0;
-}
-
-static int
-hmacmd5setkey (void *ctx, const void *key, size_t keysize)
-{
-  struct hmacctx *p = ctx;
-
-  if (p->key)
-    gnutls_free (p->key);
-
-  p->key = gnutls_malloc (keysize);
-  if (!p->key)
-    return -1;
-
-  memcpy (p->key, key, keysize);
-  p->keysize = keysize;
-
-  return 0;
-}
-
-static int
-hmacmd5hash (void *ctx, const void *text, size_t textsize)
-{
-  struct hmacctx *p = ctx;
-  char *new;
-
-  new = gnutls_realloc (p->data, p->datasize + textsize);
-  if (!new)
-    return -1;
-
-  memcpy (new + p->datasize, text, textsize);
-
-  p->data = new;
-  p->datasize += textsize;
-
-  return 0;
-}
-
-static int
-hmacmd5output (void *ctx, void *digest, size_t digestsize)
-{
-  struct hmacctx *p = ctx;
-  char out[MD5_DIGEST_SIZE];
-  int ret;
-
-  ret = hmac_md5 (p->key, p->keysize, p->data, p->datasize, out);
-  if (ret)
-    return GNUTLS_E_HASH_FAILED;
-
-  memcpy (digest, out, digestsize);
-
-  return 0;
-}
-
-static void
-hmacmd5deinit (void *ctx)
-{
-  struct hmacctx *p = ctx;
-
-  if (p->data)
-    gnutls_free (p->data);
-  if (p->key)
-    gnutls_free (p->key);
-
-  gnutls_free (p);
-}
-
-static gnutls_crypto_digest_st dig = {
-  .init = md5init,
-  .hash = md5hash,
-  .copy = md5copy,
-  .output = md5output,
-  .deinit = md5deinit
-};
-
-static gnutls_crypto_mac_st mac = {
-  .init = hmacmd5init,
-  .setkey = hmacmd5setkey,
-  .hash = hmacmd5hash,
-  .output = hmacmd5output,
-  .deinit = hmacmd5deinit
-};
-
-/**
- * gnutls_register_md5_handler:
- *
- * Register a non-libgcrypt based MD5 and HMAC-MD5 handler.  This is
- * useful if you run Libgcrypt in FIPS-mode.  Normally TLS requires
- * use of MD5, so without this you cannot use GnuTLS with libgcrypt in
- * FIPS mode.
- *
- * Returns: %GNUTLS_E_SUCCESS on success, otherwise an error.
- *
- * Since: 2.6.0
- **/
-int
-gnutls_register_md5_handler (void)
-{
-  int ret;
-
-  ret = gnutls_crypto_single_digest_register (GNUTLS_DIG_MD5, INT_MAX, &dig);
-  if (ret)
-    return ret;
-
-  ret = gnutls_crypto_single_mac_register (GNUTLS_MAC_MD5, INT_MAX, &mac);
-  if (ret)
-    return ret;
-
-  return 0;
-}
diff --git a/libextra/gnutls_extra.c b/libextra/gnutls_extra.c
index 71d051a..a7a4b80 100644
--- a/libextra/gnutls_extra.c
+++ b/libextra/gnutls_extra.c
@@ -66,23 +66,6 @@ gnutls_global_init_extra (void)
   if (_gnutls_init_extra != 1)
     return 0;
 
-#ifdef HAVE_GCRYPT
-#ifdef gcry_fips_mode_active
-  /* Libgcrypt manual says that gcry_version_check must be called
-     before calling gcry_fips_mode_active. */
-  gcry_check_version (NULL);
-  if (gcry_fips_mode_active ())
-    {
-      int ret;
-
-      ret = gnutls_register_md5_handler ();
-      if (ret)
-        fprintf (stderr, "gnutls_register_md5_handler: %s\n",
-                 gnutls_strerror (ret));
-    }
-#endif
-#endif
-
   return 0;
 }
 


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]