[gnutls-dev] gnutls_free_dh_info

Nikos Mavrogiannopoulos nmav at gnutls.org
Thu Apr 21 09:03:56 CEST 2005


On Thursday 21 April 2005 03:21, Paul Querna wrote:
> Hello,
>
> I am the developer of mod_gnutls for Apache, and I recently upgraded to
> 1.2.1 from 1.2.0.
> It looks like _gnutls_free_auth_info was changed to call
> _gnutls_free_dh_info and _gnutls_free_rsa_info.  These are attempting to
> free() data wrongly for me.
Hello Paul,
 Does the following patch to gnutls, solves this problem?
Does this only happen while resuming sessions? 
It seems I was freeing data from a stored session (that probably have
been freed before).

-- 
Nikos Mavrogiannopoulos
-------------- next part --------------
Index: gnutls_session_pack.c
===================================================================
RCS file: /cvs/gnutls/gnutls/lib/gnutls_session_pack.c,v
retrieving revision 2.29
diff -u -r2.29 gnutls_session_pack.c
--- gnutls_session_pack.c	19 Mar 2005 14:24:44 -0000	2.29
+++ gnutls_session_pack.c	21 Apr 2005 06:58:56 -0000
@@ -178,6 +178,8 @@
     return pack_size;
 }
 
+/* Load session data from a buffer.
+ */
 int _gnutls_session_unpack(gnutls_session_t session,
 			   const gnutls_datum_t * packed_session)
 {
@@ -255,7 +257,6 @@
 	    /* Delete the DH parameters. (this might need to be moved to a function)
 	     */
 	    info = session->key->auth_info;
-	    _gnutls_free_dh_info( &info->dh);
 	    memset(&info->dh, 0, sizeof(dh_info_st));
 	}
 	break;
@@ -389,7 +390,8 @@
     return pack_size + PACK_HEADER_SIZE + sizeof(uint32);
 }
 
-
+/* Load session data.
+ */
 int _gnutls_unpack_certificate_auth_info(cert_auth_info_t info,
 					 const gnutls_datum_t *
 					 packed_session)
@@ -404,8 +406,6 @@
 
     /* Delete the dh_info_st and rsa_info_st fields.
      */
-    _gnutls_free_dh_info( &info->dh);
-    _gnutls_free_rsa_info( &info->rsa_export);
     memset(&info->dh, 0, sizeof(dh_info_st));
     memset(&info->rsa_export, 0, sizeof(rsa_info_st));
 


More information about the Gnutls-dev mailing list