[Pkg-gnutls-commits] r501 - in /packages/gnutls26/trunk/debian: changelog patches/20_nulltermfix_465197.diff patches/21_nulltermfix_465197_part2.diff

ametzler at users.alioth.debian.org ametzler at users.alioth.debian.org
Mon Feb 18 18:23:20 UTC 2008


Author: ametzler
Date: Mon Feb 18 18:23:19 2008
New Revision: 501

URL: http://svn.debian.org/wsvn/pkg-gnutls/?sc=1&rev=501
Log:
Pulled from upstream:
  + debian/patches/20_nulltermfix_465197.diff
    debian/patches/21_nulltermfix_465197_part2.diff
    Corrected the behaviour of gnutls_x509_crt_get_subject_alt_name()
    and gnutls_x509_crt_get_subject_alt_name() to not null terminate binary
    strings and return the proper size.
    corrected string handling in parse_general_name.
    Closes: #465197

Added:
    packages/gnutls26/trunk/debian/patches/20_nulltermfix_465197.diff
    packages/gnutls26/trunk/debian/patches/21_nulltermfix_465197_part2.diff
Modified:
    packages/gnutls26/trunk/debian/changelog

Modified: packages/gnutls26/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/trunk/debian/changelog?rev=501&op=diff
==============================================================================
--- packages/gnutls26/trunk/debian/changelog (original)
+++ packages/gnutls26/trunk/debian/changelog Mon Feb 18 18:23:19 2008
@@ -1,6 +1,14 @@
 gnutls26 (2.2.1-4) UNRELEASED; urgency=low
 
   * NOT RELEASED YET
+  * Pulled from upstream:
+    + debian/patches/20_nulltermfix_465197.diff
+      debian/patches/21_nulltermfix_465197_part2.diff
+      Corrected the behaviour of gnutls_x509_crt_get_subject_alt_name()
+      and gnutls_x509_crt_get_subject_alt_name() to not null terminate binary
+      strings and return the proper size.
+      corrected string handling in parse_general_name.
+      Closes: #465197
 
  -- Andreas Metzler <ametzler at debian.org>  Mon, 04 Feb 2008 19:56:59 +0100
 

Added: packages/gnutls26/trunk/debian/patches/20_nulltermfix_465197.diff
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/trunk/debian/patches/20_nulltermfix_465197.diff?rev=501&op=file
==============================================================================
--- packages/gnutls26/trunk/debian/patches/20_nulltermfix_465197.diff (added)
+++ packages/gnutls26/trunk/debian/patches/20_nulltermfix_465197.diff Mon Feb 18 18:23:19 2008
@@ -1,0 +1,74 @@
+http://bugs.debian.org/465197
+
+From: Nikos <nmav at crystal.(none)>
+Date: Fri, 15 Feb 2008 21:00:25 +0000 (+0200)
+Subject: null terminate only printable strings.
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=gnutls.git;a=commitdiff_plain;h=4c50a164218ce1bef657961e5fb40c19cff56fc3
+
+null terminate only printable strings.
+---
+
+diff --git a/lib/x509/x509.c b/lib/x509/x509.c
+index f1dd604..a5857b0 100644
+--- a/lib/x509/x509.c
++++ b/lib/x509/x509.c
+@@ -888,6 +888,15 @@ gnutls_x509_crt_get_pk_algorithm (gnutls_x509_crt_t cert, unsigned int *bits)
+ 
+ }
+ 
++inline static int is_type_printable(int type)
++{
++      if (type == GNUTLS_SAN_DNSNAME || type == GNUTLS_SAN_RFC822NAME ||
++        type == GNUTLS_SAN_URI) 
++        return 1;
++      else
++        return 0;
++}
++
+ #define XMPP_OID "1.3.6.1.5.5.7.8.5"
+ 
+ /* returns the type and the name on success.
+@@ -1025,23 +1034,38 @@ parse_general_name (ASN1_TYPE src, const char *src_name,
+     return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
+   else
+     {
++      size_t orig_name_size = *name_size;
++      
+       _gnutls_str_cat (nptr, sizeof (nptr), ".");
+       _gnutls_str_cat (nptr, sizeof (nptr), choice_type);
+ 
+       len = *name_size;
+       result = asn1_read_value (src, nptr, name, &len);
+-      *name_size = len + 1;
++      *name_size = len;
+ 
+       if (result == ASN1_MEM_ERROR)
+-	return GNUTLS_E_SHORT_MEMORY_BUFFER;
+-      
++  	  return GNUTLS_E_SHORT_MEMORY_BUFFER;
++
+       if (result != ASN1_SUCCESS)
+ 	{
+ 	  gnutls_assert ();
+ 	  return _gnutls_asn2err (result);
+ 	}
+-      
+-      ((char*)name)[len] = 0;
++
++      if (is_type_printable(type))
++        {
++    
++          if (len+1 > orig_name_size)
++            {
++              gnutls_assert();
++              (*name_size)++;
++              return GNUTLS_E_SHORT_MEMORY_BUFFER;
++            }
++
++          /* null terminate it */
++          ((char*)name)[*name_size] = 0; 
++        }
++
+     }
+ 
+   return type;

Added: packages/gnutls26/trunk/debian/patches/21_nulltermfix_465197_part2.diff
URL: http://svn.debian.org/wsvn/pkg-gnutls/packages/gnutls26/trunk/debian/patches/21_nulltermfix_465197_part2.diff?rev=501&op=file
==============================================================================
--- packages/gnutls26/trunk/debian/patches/21_nulltermfix_465197_part2.diff (added)
+++ packages/gnutls26/trunk/debian/patches/21_nulltermfix_465197_part2.diff Mon Feb 18 18:23:19 2008
@@ -1,0 +1,26 @@
+http://bugs.debian.org/465197
+
+From: Nikos <nmav at crystal.(none)>
+Date: Sun, 17 Feb 2008 18:37:24 +0000 (+0200)
+Subject: corrected string handling in parse_general_name. Thanks to Andreas Metzler for pointi ...
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=gnutls.git;a=commitdiff_plain;h=38613e1dd06563e40c1996d01df88d3f2cbd57a3
+
+corrected string handling in parse_general_name. Thanks to Andreas Metzler for pointing out.
+---
+
+diff --git a/lib/x509/x509.c b/lib/x509/x509.c
+index a5857b0..93e81bb 100644
+--- a/lib/x509/x509.c
++++ b/lib/x509/x509.c
+@@ -1043,8 +1043,10 @@ parse_general_name (ASN1_TYPE src, const char *src_name,
+       result = asn1_read_value (src, nptr, name, &len);
+       *name_size = len;
+ 
+-      if (result == ASN1_MEM_ERROR)
++      if (result == ASN1_MEM_ERROR) {
++          if (is_type_printable(type)) (*name_size)++;
+   	  return GNUTLS_E_SHORT_MEMORY_BUFFER;
++      }
+ 
+       if (result != ASN1_SUCCESS)
+ 	{




More information about the Pkg-gnutls-commits mailing list