]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix secure memory initialization of libgcrypt.
authorSimon Josefsson <simon@josefsson.org>
Mon, 18 Aug 2008 12:46:33 +0000 (14:46 +0200)
committerSimon Josefsson <simon@josefsson.org>
Mon, 18 Aug 2008 12:46:33 +0000 (14:46 +0200)
Reported by Joe Orton <joe@manyfish.co.uk> in
<http://permalink.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/2992>.

lib/gnutls_global.c

index ad0dde6c624d4826738c367dd2c9f194f82245ea..d94b9266775f1cb02363006dc321bf79f66c288a 100644 (file)
@@ -250,11 +250,6 @@ gnutls_global_init (void)
          return GNUTLS_E_INCOMPATIBLE_GCRYPT_LIBRARY;
        }
 
-      /* for gcrypt in order to be able to allocate memory */
-      gcry_set_allocation_handler (gnutls_malloc, gnutls_secure_malloc,
-                                  _gnutls_is_secure_memory, gnutls_realloc,
-                                  gnutls_free);
-
       /* gcry_control (GCRYCTL_DISABLE_INTERNAL_LOCKING, NULL, 0); */
 
       gcry_control (GCRYCTL_INITIALIZATION_FINISHED, NULL, 0);
@@ -267,6 +262,11 @@ gnutls_global_init (void)
 #endif
     }
 
+  /* for gcrypt in order to be able to allocate memory */
+  gcry_set_allocation_handler (gnutls_malloc, gnutls_secure_malloc,
+                              _gnutls_is_secure_memory, gnutls_realloc,
+                              gnutls_free);
+
 #ifdef DEBUG
   gnutls_global_set_log_function (dlog);
 #endif