From: Simon Josefsson Date: Mon, 18 Aug 2008 12:46:33 +0000 (+0200) Subject: Fix secure memory initialization of libgcrypt. X-Git-Tag: gnutls_2_5_4~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb0b38f2869b46e1e2edabdbcca8817540e4602c;p=thirdparty%2Fgnutls.git Fix secure memory initialization of libgcrypt. Reported by Joe Orton in . --- diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c index ad0dde6c62..d94b926677 100644 --- a/lib/gnutls_global.c +++ b/lib/gnutls_global.c @@ -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