summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-09-15 21:43:10 +0300
committerNikos Mavrogiannopoulos <nmav@crystal.(none)>2008-09-15 21:43:10 +0300
commit7ad5ce4bd98d0fa3c032f30a5f11c6d34d5438a2 (patch)
treeddb4a13387be02381adaf09ffaffccb09a531a05
parentd89d3790a7af4c871561526e3283f16e48bac541 (diff)
parent862791a58d75d01b491d7818da8ecda9ff442b43 (diff)
downloadgnutls-7ad5ce4bd98d0fa3c032f30a5f11c6d34d5438a2.tar.gz
Merge branch 'gnutls_2_4_x' of ssh://git.sv.gnu.org/srv/git/gnutls into gnutls_2_4_x
-rw-r--r--NEWS16
-rw-r--r--lib/gnutls_cipher_int.c10
-rw-r--r--lib/minitasn1/element.c25
-rw-r--r--lib/minitasn1/libtasn1.h2
-rw-r--r--tests/openssl.c5
5 files changed, 47 insertions, 11 deletions
diff --git a/NEWS b/NEWS
index 6f0383c85f..e43aad58bc 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,22 @@ See the end for copying conditions.
* Version 2.4.2 (unreleased)
+** libgnutls: Corrected memory leak in X.509 functions.
+Thanks to Colin Leroy <colin@colino.net>.
+
+** libgnutls: Fix compile error with Sun CC.
+
+** gnutls-cli.1: Document all new parameters.
+Thanks to James Westby <jw+debian@jameswestby.net>.
+
+** tests/openssl: initialize gnutls before use.
+Fixes crash with libgcrypt 1.4.2. Reported by Ludovic Courtes
+<ludovic.courtes@laas.fr>.
+
+** doc/: Fix texinfo markup for old texinfo versions.
+
+** Included copy of libtasn1 is upgraded to version 1.5.
+
** API and ABI modifications:
No changes since last version.
diff --git a/lib/gnutls_cipher_int.c b/lib/gnutls_cipher_int.c
index a7b50b9b1c..67cd7cf2b6 100644
--- a/lib/gnutls_cipher_int.c
+++ b/lib/gnutls_cipher_int.c
@@ -173,9 +173,11 @@ _gnutls_cipher_deinit (cipher_hd_st* handle)
{
if (handle != NULL)
{
- if (handle->registered && handle->hd.rh.ctx != NULL) {
- return handle->hd.rh.cc->deinit( handle->hd.rh.ctx);
- }
- gc_cipher_close (handle->hd.gc);
+ if (handle->registered && handle->hd.rh.ctx != NULL)
+ {
+ handle->hd.rh.cc->deinit( handle->hd.rh.ctx);
+ return;
+ }
}
+ gc_cipher_close (handle->hd.gc);
}
diff --git a/lib/minitasn1/element.c b/lib/minitasn1/element.c
index 752b40da85..703276c809 100644
--- a/lib/minitasn1/element.c
+++ b/lib/minitasn1/element.c
@@ -420,7 +420,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
asn1_length_der (len - k, NULL, &len2);
temp = (unsigned char *) _asn1_malloc (len - k + len2);
if (temp == NULL)
- return ASN1_MEM_ALLOC_ERROR;
+ {
+ _asn1_free (value_temp);
+ return ASN1_MEM_ALLOC_ERROR;
+ }
asn1_octet_der (value_temp + k, len - k, temp, &len2);
_asn1_set_value (node, temp, len2);
@@ -438,7 +441,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
default_temp =
(unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
if (default_temp == NULL)
- return ASN1_MEM_ALLOC_ERROR;
+ {
+ _asn1_free (value_temp);
+ return ASN1_MEM_ALLOC_ERROR;
+ }
_asn1_convert_integer (p->value, default_temp,
SIZEOF_UNSIGNED_LONG_INT, &len2);
@@ -446,7 +452,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
else
{ /* is an identifier like v1 */
if (!(node->type & CONST_LIST))
- return ASN1_VALUE_NOT_VALID;
+ {
+ _asn1_free (value_temp);
+ return ASN1_VALUE_NOT_VALID;
+ }
p2 = node->down;
while (p2)
{
@@ -458,7 +467,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
(unsigned char *)
_asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
if (default_temp == NULL)
- return ASN1_MEM_ALLOC_ERROR;
+ {
+ _asn1_free (value_temp);
+ return ASN1_MEM_ALLOC_ERROR;
+ }
_asn1_convert_integer (p2->value,
default_temp,
@@ -470,7 +482,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
p2 = p2->right;
}
if (p2 == NULL)
- return ASN1_VALUE_NOT_VALID;
+ {
+ _asn1_free (value_temp);
+ return ASN1_VALUE_NOT_VALID;
+ }
}
diff --git a/lib/minitasn1/libtasn1.h b/lib/minitasn1/libtasn1.h
index fd35867367..d7d4f70a7c 100644
--- a/lib/minitasn1/libtasn1.h
+++ b/lib/minitasn1/libtasn1.h
@@ -31,7 +31,7 @@ extern "C"
{
#endif
-#define LIBTASN1_VERSION "1.4"
+#define LIBTASN1_VERSION "1.5"
#include <sys/types.h>
#include <time.h>
diff --git a/tests/openssl.c b/tests/openssl.c
index 2fa9f8c3ca..5cffa25b6c 100644
--- a/tests/openssl.c
+++ b/tests/openssl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005 Free Software Foundation
+ * Copyright (C) 2004, 2005, 2008 Free Software Foundation
*
* Author: Simon Josefsson
*
@@ -36,6 +36,9 @@ doit (void)
MD5_CTX c;
unsigned char md[MD5_DIGEST_LENGTH];
+ if (gnutls_global_init() != 0)
+ fail ("gnutls_global_init\n");
+
if (!gnutls_check_version (LIBGNUTLS_VERSION))
success ("gnutls_check_version ERROR\n");