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_2_11_6-413-g871a12f


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_11_6-413-g871a12f
Date: Fri, 08 Apr 2011 15:36:49 +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=871a12f18160544b6a1206ea5502cab83d1c03dc

The branch, master has been updated
       via  871a12f18160544b6a1206ea5502cab83d1c03dc (commit)
       via  b9bc4becb76eaa7a9367510f432906440784ccc9 (commit)
       via  f248f64aa825cff8e7d08ffe79709200adcf6214 (commit)
       via  6448dd61e8b95c265c590ba6c91d10c6c56176b2 (commit)
       via  f5c1890641fa7868245bde407305cf193bab1f30 (commit)
       via  7f9862c3ed30ef1fd0e4da47b11d6b99ed1e6494 (commit)
      from  b0fe8dba5e7adde4067e660360a078f4d97ec3f2 (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 871a12f18160544b6a1206ea5502cab83d1c03dc
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 17:31:26 2011 +0200

    corrected leaks in tests.

commit b9bc4becb76eaa7a9367510f432906440784ccc9
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 17:27:54 2011 +0200

    corrected memory leak on RSA signatures.

commit f248f64aa825cff8e7d08ffe79709200adcf6214
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 17:17:24 2011 +0200

    more leaks fixed in common.c

commit 6448dd61e8b95c265c590ba6c91d10c6c56176b2
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 17:08:54 2011 +0200

    Corrected leaks in gnutls_pubkey_t deinitialization.

commit f5c1890641fa7868245bde407305cf193bab1f30
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 16:58:21 2011 +0200

    fix in trusted_list certificate deinitialization.

commit 7f9862c3ed30ef1fd0e4da47b11d6b99ed1e6494
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 16:50:31 2011 +0200

    correction in deinitialization of privkey.

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

Summary of changes:
 lib/auth_cert.c               |    2 +-
 lib/gnutls_pk.c               |    9 ++++++---
 lib/gnutls_privkey.c          |    3 +++
 lib/gnutls_pubkey.c           |    7 +++++++
 lib/x509/common.c             |   18 ++++--------------
 lib/x509/verify-high.c        |    2 ++
 tests/mini-x509-rehandshake.c |    1 +
 tests/openpgp-auth.c          |    7 +++++++
 tests/openpgp-auth2.c         |    7 +++++++
 9 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/lib/auth_cert.c b/lib/auth_cert.c
index e6b2eee..c760e50 100644
--- a/lib/auth_cert.c
+++ b/lib/auth_cert.c
@@ -1593,7 +1593,7 @@ _gnutls_gen_cert_client_cert_vrfy (gnutls_session_t 
session, gnutls_buffer_st *
       goto cleanup;
     }
 
-  return data->length;
+  ret = data->length;
 
 cleanup:
   _gnutls_free_datum (&signature);
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c
index 9fa0326..f6284fd 100644
--- a/lib/gnutls_pk.c
+++ b/lib/gnutls_pk.c
@@ -185,8 +185,8 @@ _gnutls_pkcs1_rsa_encrypt (gnutls_datum_t * ciphertext,
   if (ciphertext->data == NULL)
     {
       gnutls_assert ();
-      _gnutls_free_datum (&encrypted);
-      return GNUTLS_E_MEMORY_ERROR;
+      ret = GNUTLS_E_MEMORY_ERROR;
+      goto cleanup;
     }
 
   memcpy (&ciphertext->data[pad], encrypted.data, encrypted.size);
@@ -195,9 +195,12 @@ _gnutls_pkcs1_rsa_encrypt (gnutls_datum_t * ciphertext,
 
   ciphertext->size = k;
 
+  ret = 0;
+
+cleanup:
   _gnutls_free_datum (&encrypted);
 
-  return 0;
+  return ret;
 }
 
 
diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c
index 373799a..4dc83b4 100644
--- a/lib/gnutls_privkey.c
+++ b/lib/gnutls_privkey.c
@@ -273,11 +273,14 @@ gnutls_privkey_deinit (gnutls_privkey_t key)
 #ifdef ENABLE_OPENPGP
       case GNUTLS_PRIVKEY_OPENPGP:
         gnutls_openpgp_privkey_deinit (key->key.openpgp);
+        break;
 #endif
       case GNUTLS_PRIVKEY_PKCS11:
         gnutls_pkcs11_privkey_deinit (key->key.pkcs11);
+        break;
       case GNUTLS_PRIVKEY_X509:
         gnutls_x509_privkey_deinit (key->key.x509);
+        break;
       }
   gnutls_free (key);
 }
diff --git a/lib/gnutls_pubkey.c b/lib/gnutls_pubkey.c
index 0075f39..1775a62 100644
--- a/lib/gnutls_pubkey.c
+++ b/lib/gnutls_pubkey.c
@@ -147,6 +147,13 @@ gnutls_pubkey_init (gnutls_pubkey_t * key)
 void
 gnutls_pubkey_deinit (gnutls_pubkey_t key)
 {
+int i;
+
+  for (i = 0; i < key->params_size; i++)
+    {
+      _gnutls_mpi_release (&key->params[i]);
+    }
+
   gnutls_free (key);
 }
 
diff --git a/lib/x509/common.c b/lib/x509/common.c
index 21774df..51dc97a 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -1112,14 +1112,6 @@ _gnutls_x509_write_value (ASN1_TYPE c, const char *root,
     {
       /* Convert it to OCTET STRING
        */
-      val.data = gnutls_malloc (asize);
-      if (val.data == NULL)
-        {
-          gnutls_assert ();
-          result = GNUTLS_E_MEMORY_ERROR;
-          goto cleanup;
-        }
-
       if ((result = asn1_create_element
            (_gnutls_get_pkix (), "PKIX1.pkcs-7-Data", &c2)) != ASN1_SUCCESS)
         {
@@ -1153,19 +1145,17 @@ _gnutls_x509_write_value (ASN1_TYPE c, const char *root,
   /* Write the data.
    */
   result = asn1_write_value (c, root, val.data, val.size);
-
-  if (val.data != data->data)
-    _gnutls_free_datum (&val);
-
   if (result != ASN1_SUCCESS)
     {
       gnutls_assert ();
-      return _gnutls_asn2err (result);
+      result = _gnutls_asn2err (result);
+      goto cleanup;
     }
 
-  return 0;
+  result = 0;
 
 cleanup:
+  asn1_delete_structure (&c2);
   if (val.data != data->data)
     _gnutls_free_datum (&val);
   return result;
diff --git a/lib/x509/verify-high.c b/lib/x509/verify-high.c
index 4849764..479f3c2 100644
--- a/lib/x509/verify-high.c
+++ b/lib/x509/verify-high.c
@@ -110,10 +110,12 @@ int i, j;
             {
               gnutls_x509_crt_deinit(list->node[i].trusted_crts[j]);
             }
+          gnutls_free(list->node[i].trusted_crts);
           for (j=0;j<list->node[i].crl_size;j++)
             {
               gnutls_x509_crl_deinit(list->node[i].crls[j]);
             }
+          gnutls_free(list->node[i].crls);
         }
     }
 
diff --git a/tests/mini-x509-rehandshake.c b/tests/mini-x509-rehandshake.c
index 52cc4c0..04d7c22 100644
--- a/tests/mini-x509-rehandshake.c
+++ b/tests/mini-x509-rehandshake.c
@@ -146,6 +146,7 @@ doit (void)
   gnutls_deinit (server);
 
   gnutls_certificate_free_credentials (serverx509cred);
+  gnutls_certificate_free_credentials (clientx509cred);
 
   gnutls_global_deinit ();
 
diff --git a/tests/openpgp-auth.c b/tests/openpgp-auth.c
index 1ffb3d4..c356a3d 100644
--- a/tests/openpgp-auth.c
+++ b/tests/openpgp-auth.c
@@ -161,6 +161,9 @@ doit ()
 
           if (debug)
             printf ("client done\n");
+          
+          gnutls_deinit(session);
+          gnutls_certificate_free_credentials (cred);
         }
       else
         {
@@ -238,6 +241,10 @@ doit ()
           if (debug)
             printf ("server done\n");
 
+          gnutls_deinit(session);
+          gnutls_certificate_free_credentials (cred);
+          gnutls_dh_params_deinit (dh_params);
+
           done = wait (&status);
           if (done < 0)
             fail ("wait %s\n", strerror (errno));
diff --git a/tests/openpgp-auth2.c b/tests/openpgp-auth2.c
index b18c932..85820cc 100644
--- a/tests/openpgp-auth2.c
+++ b/tests/openpgp-auth2.c
@@ -151,6 +151,9 @@ doit ()
 
       if (debug)
         printf ("client done\n");
+
+      gnutls_deinit(session);
+      gnutls_certificate_free_credentials (cred);
     }
   else
     {
@@ -222,6 +225,10 @@ doit ()
       if (debug)
         printf ("server done\n");
 
+      gnutls_deinit(session);
+      gnutls_certificate_free_credentials (cred);
+      gnutls_dh_params_deinit (dh_params);
+
       done = wait (&status);
       if (done < 0)
         fail ("wait %s\n", strerror (errno));


hooks/post-receive
-- 
GNU gnutls



reply via email to

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