gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_12-3-g5abca


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_12-3-g5abca4a
Date: Mon, 07 Nov 2011 21:39:43 +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=5abca4a0f8938bf5f3a2b31cc4e08dd7c6ff67ef

The branch, gnutls_2_12_x has been updated
       via  5abca4a0f8938bf5f3a2b31cc4e08dd7c6ff67ef (commit)
       via  8892daec08200382bb291cdf3e8f55b708423086 (commit)
       via  7fc8fa6464d305440fddab423079c76a915decc3 (commit)
      from  e89c53670aa2ac9f251066689de060f61b1a868d (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 5abca4a0f8938bf5f3a2b31cc4e08dd7c6ff67ef
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Nov 7 21:36:49 2011 +0100

    documented updates

commit 8892daec08200382bb291cdf3e8f55b708423086
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Nov 7 21:25:36 2011 +0100

    upgraded to minitasn 2.10

commit 7fc8fa6464d305440fddab423079c76a915decc3
Author: Alban Crequy <address@hidden>
Date:   Mon Nov 7 18:51:27 2011 +0000

    gnutls_session_get_data: fix possible buffer overflow
    
    The test to avoid the buffer overflow was always false because
    session_data_size was set at the wrong place. This problem has been 
introduced
    by this commit:
    
    |commit ad4ed44c65e753e6d3a00104c049dd81826ccbf3
    |Author: Nikos Mavrogiannopoulos <address@hidden>
    |Date:   Mon Nov 7 22:24:48 2005 +0000
    |
    |    This is the initial commit in the 1.3 branch. Ported from the PSK 
branch:
    |    * PSK ciphersuites have been added.
    |    * The session resumption data are now system independent.
    
    Signed-off-by: Nikos Mavrogiannopoulos <address@hidden>

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

Summary of changes:
 NEWS                       |   11 +++++++++
 lib/gnutls_session.c       |    2 +-
 lib/minitasn1/coding.c     |   25 +++++++++------------
 lib/minitasn1/decoding.c   |    5 +--
 lib/minitasn1/element.c    |   39 +++++++++++-----------------------
 lib/minitasn1/element.h    |    4 +-
 lib/minitasn1/errors.c     |    2 +-
 lib/minitasn1/gstr.c       |    2 +-
 lib/minitasn1/gstr.h       |    2 +-
 lib/minitasn1/int.h        |    4 +-
 lib/minitasn1/libtasn1.h   |    6 ++--
 lib/minitasn1/parser_aux.c |    4 +-
 lib/minitasn1/parser_aux.h |    4 +-
 lib/minitasn1/structure.c  |   49 +++++++++++++------------------------------
 lib/minitasn1/structure.h  |    2 +-
 lib/minitasn1/version.c    |    4 +-
 16 files changed, 70 insertions(+), 95 deletions(-)

diff --git a/NEWS b/NEWS
index 7b63fb0..fa8865c 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,17 @@ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
               2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
+Version 2.12.13 (released 2011-11-07)
+
+** minitasn1: Upgraded to libtasn1 version 2.10.
+
+** libgnutls: Fixed possible buffer overflow in 
+gnutls_session_get_data(). Reported and fix by Alban Crequy.
+
+** API and ABI modifications:
+No changes since last version.
+
+
 Version 2.12.12 (released 2011-10-20)
 
 ** gnulib: updated
diff --git a/lib/gnutls_session.c b/lib/gnutls_session.c
index 6a37f13..4ab1ef5 100644
--- a/lib/gnutls_session.c
+++ b/lib/gnutls_session.c
@@ -65,13 +65,13 @@ gnutls_session_get_data (gnutls_session_t session,
       gnutls_assert ();
       return ret;
     }
-  *session_data_size = psession.size;
 
   if (psession.size > *session_data_size)
     {
       ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
       goto error;
     }
+  *session_data_size = psession.size;
 
   if (session_data != NULL)
     memcpy (session_data, psession.data, psession.size);
diff --git a/lib/minitasn1/coding.c b/lib/minitasn1/coding.c
index 31b5ebb..3cc0ef8 100644
--- a/lib/minitasn1/coding.c
+++ b/lib/minitasn1/coding.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2004, 2006, 2008, 2009, 2010 Free Software
+ * Copyright (C) 2002, 2004, 2006, 2008, 2009, 2010, 2011 Free Software
  * Foundation, Inc.
  *
  * This file is part of LIBTASN1.
@@ -256,15 +256,17 @@ _asn1_objectid_der (unsigned char *str, unsigned char 
*der, int *der_len)
   char *temp, *n_end, *n_start;
   unsigned char bit7;
   unsigned long val, val1 = 0;
+  int str_len = strlen(str);
 
   max_len = *der_len;
 
-  temp = (char *) _asn1_malloc (strlen (str) + 2);
+  temp = _asn1_malloc (str_len + 2);
   if (temp == NULL)
     return ASN1_MEM_ALLOC_ERROR;
 
-  strcpy (temp, str);
-  strcat (temp, ".");
+  memcpy (temp, str, str_len);
+  temp[str_len] = '.';
+  temp[str_len+1] = 0;
 
   counter = 0;
   n_start = temp;
@@ -857,16 +859,11 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
ASN1_TYPE node)
  * Creates the DER encoding for the NAME structure (inside *POINTER
  * structure).
  *
- * Returns:
- *
- *   %ASN1_SUCCESS: DER encoding OK.
- *
- *   %ASN1_ELEMENT_NOT_FOUND: NAME is not a valid element.
- *
- *   %ASN1_VALUE_NOT_FOUND: There is an element without a value.
- *
- *   %ASN1_MEM_ERROR: @ider vector isn't big enough. Also in this case
- *     LEN will contain the length needed.
+ * Returns: %ASN1_SUCCESS if DER encoding OK, %ASN1_ELEMENT_NOT_FOUND
+ *   if @name is not a valid element, %ASN1_VALUE_NOT_FOUND if there
+ *   is an element without a value, %ASN1_MEM_ERROR if the @ider
+ *   vector isn't big enough and in this case @len will contain the
+ *   length needed.
  **/
 asn1_retCode
 asn1_der_coding (ASN1_TYPE element, const char *name, void *ider, int *len,
diff --git a/lib/minitasn1/decoding.c b/lib/minitasn1/decoding.c
index 8c8b01f..3849375 100644
--- a/lib/minitasn1/decoding.c
+++ b/lib/minitasn1/decoding.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2004, 2006, 2008, 2009, 2010 Free Software
+ * Copyright (C) 2002, 2004, 2006, 2008, 2009, 2010, 2011 Free Software
  * Foundation, Inc.
  *
  * This file is part of LIBTASN1.
@@ -1367,7 +1367,7 @@ asn1_der_decoding_element (ASN1_TYPE * structure, const 
char *elementName,
   char temp[128], currentName[ASN1_MAX_NAME_SIZE * 10], *dot_p, *char_p;
   int nameLen = ASN1_MAX_NAME_SIZE * 10 - 1, state;
   int counter, len2, len3, len4, move, ris, tlen;
-  unsigned char class, *temp2;
+  unsigned char class;
   unsigned long tag;
   int indefinite, result;
   const unsigned char *der = ider;
@@ -1921,7 +1921,6 @@ asn1_der_decoding_element (ASN1_TYPE * structure, const 
char *elementName,
                  if (state == FOUND)
                    {
                      _asn1_set_value_octet (p, der + counter, len2 + len3);
-                     temp2 = NULL;
 
                      if (p == nodeFound)
                        state = EXIT;
diff --git a/lib/minitasn1/element.c b/lib/minitasn1/element.c
index 51ade14..a8fdc92 100644
--- a/lib/minitasn1/element.c
+++ b/lib/minitasn1/element.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010
- * Free Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010,
+ * 2011 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -264,13 +264,9 @@ _asn1_append_sequence_set (ASN1_TYPE node)
  *           result=asn1_write_value(cert,
  *           "tbsCertificate.subject.rdnSequence.?LAST", "NEW", 1);
  *
- * Returns:
- *
- *   %ASN1_SUCCESS: Set value OK.
- *
- *   %ASN1_ELEMENT_NOT_FOUND: NAME is not a valid element.
- *
- *   %ASN1_VALUE_NOT_VALID: VALUE has a wrong format.
+ * Returns: %ASN1_SUCCESS if the value was set,
+ *   %ASN1_ELEMENT_NOT_FOUND if @name is not a valid element, and
+ *   %ASN1_VALUE_NOT_VALID if @ivalue has a wrong format.
  **/
 asn1_retCode
 asn1_write_value (ASN1_TYPE node_root, const char *name,
@@ -697,16 +693,12 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
  * ANY: If NAME indicates an any type, VALUE will indicate the DER
  *   encoding of the structure actually used.
  *
- * Returns:
- *
- *   %ASN1_SUCCESS: Set value OK.
- *
- *   %ASN1_ELEMENT_NOT_FOUND: NAME is not a valid element.
- *
- *   %ASN1_VALUE_NOT_FOUND: There isn't any value for the element selected.
- *
- *   %ASN1_MEM_ERROR: The value vector isn't big enough to store the result.
- *   In this case LEN will contain the number of bytes needed.
+ * Returns: %ASN1_SUCCESS if value is returned,
+ *   %ASN1_ELEMENT_NOT_FOUND if @name is not a valid element,
+ *   %ASN1_VALUE_NOT_FOUND if there isn't any value for the element
+ *   selected, and %ASN1_MEM_ERROR if The value vector isn't big enough
+ *   to store the result, and in this case @len will contain the number of
+ *   bytes needed.
  **/
 asn1_retCode
 asn1_read_value (ASN1_TYPE root, const char *name, void *ivalue, int *len)
@@ -883,11 +875,8 @@ asn1_read_value (ASN1_TYPE root, const char *name, void 
*ivalue, int *len)
  * %ASN1_CLASS_UNIVERSAL, %ASN1_CLASS_PRIVATE or
  * %ASN1_CLASS_CONTEXT_SPECIFIC.
  *
- * Returns:
- *
- *   %ASN1_SUCCESS: Set value OK.
- *
- *   %ASN1_ELEMENT_NOT_FOUND: NAME is not a valid element.
+ * Returns: %ASN1_SUCCESS if successful, %ASN1_ELEMENT_NOT_FOUND if
+ *   @name is not a valid element.
  **/
 asn1_retCode
 asn1_read_tag (ASN1_TYPE root, const char *name, int *tagValue,
@@ -986,7 +975,5 @@ asn1_read_tag (ASN1_TYPE root, const char *name, int 
*tagValue,
        }
     }
 
-
   return ASN1_SUCCESS;
-
 }
diff --git a/lib/minitasn1/element.h b/lib/minitasn1/element.h
index 95c382a..67a234f 100644
--- a/lib/minitasn1/element.h
+++ b/lib/minitasn1/element.h
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010
- * Free Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010,
+ * 2011 Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/lib/minitasn1/errors.c b/lib/minitasn1/errors.c
index 052c64f..c5508da 100644
--- a/lib/minitasn1/errors.c
+++ b/lib/minitasn1/errors.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010 Free Software
+ * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2011 Free Software
  * Foundation, Inc.
  *
  * This file is part of LIBTASN1.
diff --git a/lib/minitasn1/gstr.c b/lib/minitasn1/gstr.c
index b3f6af2..32ab904 100644
--- a/lib/minitasn1/gstr.c
+++ b/lib/minitasn1/gstr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Free Software
+ * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
  * Foundation, Inc.
  *
  * This file is part of LIBTASN1.
diff --git a/lib/minitasn1/gstr.h b/lib/minitasn1/gstr.h
index bffb912..33bdec9 100644
--- a/lib/minitasn1/gstr.h
+++ b/lib/minitasn1/gstr.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Free Software
+ * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
  * Foundation, Inc.
  *
  * This file is part of LIBTASN1.
diff --git a/lib/minitasn1/int.h b/lib/minitasn1/int.h
index def4927..6b2b5eb 100644
--- a/lib/minitasn1/int.h
+++ b/lib/minitasn1/int.h
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
- * Software Foundation, Inc.
+ * Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ * Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/lib/minitasn1/libtasn1.h b/lib/minitasn1/libtasn1.h
index fd3a139..78f7b54 100644
--- a/lib/minitasn1/libtasn1.h
+++ b/lib/minitasn1/libtasn1.h
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
- * Software Foundation, Inc.
+ * Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ * Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
@@ -45,7 +45,7 @@ extern "C"
 {
 #endif
 
-#define ASN1_VERSION "2.6"
+#define ASN1_VERSION "2.10"
 
   typedef int asn1_retCode;    /* type returned by libtasn1 functions */
 
diff --git a/lib/minitasn1/parser_aux.c b/lib/minitasn1/parser_aux.c
index a3150a8..597fe6d 100644
--- a/lib/minitasn1/parser_aux.c
+++ b/lib/minitasn1/parser_aux.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010 Free
- * Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010, 2011
+ * Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/lib/minitasn1/parser_aux.h b/lib/minitasn1/parser_aux.h
index def52ed..ca9e66c 100644
--- a/lib/minitasn1/parser_aux.h
+++ b/lib/minitasn1/parser_aux.h
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010 Free
- * Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010, 2011
+ * Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *
diff --git a/lib/minitasn1/structure.c b/lib/minitasn1/structure.c
index b1c5b30..c3d7896 100644
--- a/lib/minitasn1/structure.c
+++ b/lib/minitasn1/structure.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009, 2010 Free
+ * Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free
  * Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
@@ -168,16 +168,11 @@ _asn1_create_static_structure (ASN1_TYPE pointer, char 
*output_file_name,
  * Creates the structures needed to manage the ASN.1 definitions.
  * @array is a vector created by asn1_parser2array().
  *
- * Returns:
- *
- * %ASN1_SUCCESS: Structure created correctly.
- *
- * %ASN1_ELEMENT_NOT_EMPTY: address@hidden not ASN1_TYPE_EMPTY.
- *
- * %ASN1_IDENTIFIER_NOT_FOUND: In the file there is an identifier that
- *   is not defined (see @errorDescription for more information).
- *
- * %ASN1_ARRAY_ERROR: The array pointed by @array is wrong.
+ * Returns: %ASN1_SUCCESS if structure was created correctly,
+ *   %ASN1_ELEMENT_NOT_EMPTY if address@hidden not ASN1_TYPE_EMPTY,
+ *   %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an identifier
+ *   that is not defined (see @errorDescription for more information),
+ *   %ASN1_ARRAY_ERROR if the array pointed by @array is wrong.
  **/
 asn1_retCode
 asn1_array2tree (const ASN1_ARRAY_TYPE * array, ASN1_TYPE * definitions,
@@ -284,11 +279,8 @@ asn1_array2tree (const ASN1_ARRAY_TYPE * array, ASN1_TYPE 
* definitions,
  * Deletes the structure address@hidden  At the end, address@hidden is set
  * to ASN1_TYPE_EMPTY.
  *
- * Returns:
- *
- * %ASN1_SUCCESS: Everything OK.
- *
- * %ASN1_ELEMENT_NOT_FOUND: address@hidden was ASN1_TYPE_EMPTY.
+ * Returns: %ASN1_SUCCESS if successful, %ASN1_ELEMENT_NOT_FOUND if
+ *   address@hidden was ASN1_TYPE_EMPTY.
  **/
 asn1_retCode
 asn1_delete_structure (ASN1_TYPE * structure)
@@ -351,11 +343,8 @@ asn1_delete_structure (ASN1_TYPE * structure)
  *
  * Deletes the element named address@hidden inside address@hidden
  *
- * Returns:
- *
- * %ASN1_SUCCESS: Everything OK.
- *
- * %ASN1_ELEMENT_NOT_FOUND: The name element was not found.
+ * Returns: %ASN1_SUCCESS if successful, %ASN1_ELEMENT_NOT_FOUND if
+ *   the @element_name was not found.
  **/
 asn1_retCode
 asn1_delete_element (ASN1_TYPE structure, const char *element_name)
@@ -670,11 +659,8 @@ _asn1_expand_identifier (ASN1_TYPE * node, ASN1_TYPE root)
  *
  * rc = asn1_create_element(cert_def, "PKIX1.Certificate", certptr);
  *
- * Returns:
- *
- * %ASN1_SUCCESS: Creation OK.
- *
- * %ASN1_ELEMENT_NOT_FOUND: SOURCE_NAME isn't known
+ * Returns: %ASN1_SUCCESS if creation OK, %ASN1_ELEMENT_NOT_FOUND if
+ *   @source_name is not known.
  **/
 asn1_retCode
 asn1_create_element (ASN1_TYPE definitions, const char *source_name,
@@ -1072,13 +1058,8 @@ asn1_print_structure (FILE * out, ASN1_TYPE structure, 
const char *name,
  * Counts the number of elements of a sub-structure called NAME with
  * names equal to "?1","?2", ...
  *
- * Returns:
- *
- *  %ASN1_SUCCESS: Creation OK.
- *
- *  %ASN1_ELEMENT_NOT_FOUND: NAME isn't known.
- *
- *  %ASN1_GENERIC_ERROR: Pointer num equal to NULL.
+ * Returns: %ASN1_SUCCESS if successful, %ASN1_ELEMENT_NOT_FOUND if
+ *   @name is not known, %ASN1_GENERIC_ERROR if pointer @num is %NULL.
  **/
 asn1_retCode
 asn1_number_of_elements (ASN1_TYPE element, const char *name, int *num)
@@ -1171,7 +1152,7 @@ asn1_find_structure_from_oid (ASN1_TYPE definitions, 
const char *oidValue)
  *
  * Create a deep copy of a ASN1_TYPE variable.
  *
- * Return value: Return %ASN1_SUCCESS on success.
+ * Returns: Return %ASN1_SUCCESS on success.
  **/
 asn1_retCode
 asn1_copy_node (ASN1_TYPE dst, const char *dst_name,
diff --git a/lib/minitasn1/structure.h b/lib/minitasn1/structure.h
index 3885afc..98d32ab 100644
--- a/lib/minitasn1/structure.h
+++ b/lib/minitasn1/structure.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009, 2010 Free
+ * Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free
  * Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
diff --git a/lib/minitasn1/version.c b/lib/minitasn1/version.c
index ad7b43e..c0cf1f2 100644
--- a/lib/minitasn1/version.c
+++ b/lib/minitasn1/version.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010 Free
- * Software Foundation, Inc.
+ * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010, 2011
+ * Free Software Foundation, Inc.
  *
  * This file is part of LIBTASN1.
  *


hooks/post-receive
-- 
GNU gnutls



reply via email to

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