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_20-3-g0b9d8


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_20-3-g0b9d8d6
Date: Sat, 03 Nov 2012 17:50:26 +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=0b9d8d6f21dad85038c6de36d8fbd56271263f64

The branch, gnutls_2_12_x has been updated
       via  0b9d8d6f21dad85038c6de36d8fbd56271263f64 (commit)
       via  0ae4fd86b80bd2b9f55dd52c30201983cce050ce (commit)
       via  50a53427580d3ead5a38e492966bad0524e56d19 (commit)
      from  3e686ef013dbe016ee09a9ea4fbeca33cc67d853 (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 0b9d8d6f21dad85038c6de36d8fbd56271263f64
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sun Sep 23 19:06:00 2012 +0200

    Corrected bug in PGP subpacket encoding

commit 0ae4fd86b80bd2b9f55dd52c30201983cce050ce
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Nov 3 13:55:51 2012 +0100

    depend on libtasn1 2.14 or later.

commit 50a53427580d3ead5a38e492966bad0524e56d19
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Sep 12 22:45:55 2012 +0200

    Use the new asn1_read_node_value()

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

Summary of changes:
 NEWS                     |    9 +++++++++
 lib/m4/hooks.m4          |    6 ++----
 lib/opencdk/new-packet.c |    4 +++-
 lib/x509/x509.c          |   27 +++++++++++++++++++++------
 4 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index c394f13..f53e417 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,15 @@ 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.21 (unreleased)
+
+** libgnutls: Backported patch to compile with libtasn1 3.0.
+Minimum libtasn1 dependency is now 2.14.
+
+** API and ABI modifications:
+No changes since last version.
+
+
 Version 2.12.20 (released 2012-06-10)
 
 ** libgnutls: Fixed memory leak in PKCS #8 key import.
diff --git a/lib/m4/hooks.m4 b/lib/m4/hooks.m4
index e921f71..30c29c8 100644
--- a/lib/m4/hooks.m4
+++ b/lib/m4/hooks.m4
@@ -86,10 +86,8 @@ fi
       included_libtasn1=$withval,
       included_libtasn1=no)
   if test "$included_libtasn1" = "no"; then
-    AC_LIB_HAVE_LINKFLAGS(tasn1,, [#include <libtasn1.h>],
-                          [asn1_check_version (NULL)])
-    if test "$ac_cv_libtasn1" != yes; then
-      included_libtasn1=yes
+    PKG_CHECK_MODULES(LIBTASN1, [libtasn1 >= 2.14], [], 
[included_libtasn1=yes])
+    if test "$included_libtasn1" = yes; then
       AC_MSG_WARN([[
   *** 
   *** Libtasn1 was not found. Will use the included one.
diff --git a/lib/opencdk/new-packet.c b/lib/opencdk/new-packet.c
index b4e0933..7ef491c 100644
--- a/lib/opencdk/new-packet.c
+++ b/lib/opencdk/new-packet.c
@@ -713,8 +713,9 @@ _cdk_subpkt_get_array (cdk_subpkt_t s, int count, size_t * 
r_nbytes)
         buf[n++] = nbytes;
       else if (nbytes < 8384)
         {
+          nbytes -= 192;
           buf[n++] = nbytes / 256 + 192;
-          buf[n++] = nbytes % 256;
+          buf[n++] = nbytes & 0xff;
         }
       else
         {
@@ -724,6 +725,7 @@ _cdk_subpkt_get_array (cdk_subpkt_t s, int count, size_t * 
r_nbytes)
           buf[n++] = nbytes >> 8;
           buf[n++] = nbytes;
         }
+
       buf[n++] = list->type;
       memcpy (buf + n, list->d, list->size);
       n += list->size;
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 6f82b8b..6db574c 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -2060,10 +2060,12 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
                             int irdn, int iava, gnutls_x509_ava_st * ava)
 {
   ASN1_TYPE rdn, elem;
+  ASN1_DATA_NODE vnode;
   long len;
   int lenlen, remlen, ret;
   char rbuf[ASN1_MAX_NAME_SIZE];
-  unsigned char cls, *ptr;
+  unsigned char cls;
+  const unsigned char *ptr;
 
   iava++;
   irdn++;                       /* 0->1, 1->2 etc */
@@ -2084,8 +2086,15 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
       return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
     }
 
-  ava->oid.data = elem->value;
-  ava->oid.size = elem->value_len;
+  ret = asn1_read_node_value(elem, &vnode);
+  if (ret != ASN1_SUCCESS)
+    {
+      gnutls_assert ();
+      return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
+    }
+
+  ava->oid.data = (void*)vnode.value;
+  ava->oid.size = vnode.value_len;
 
   snprintf (rbuf, sizeof (rbuf), "?%d.value", iava);
   elem = asn1_find_node (rdn, rbuf);
@@ -2095,12 +2104,18 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
       return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
     }
 
+  ret = asn1_read_node_value(elem, &vnode);
+  if (ret != ASN1_SUCCESS)
+    {
+      gnutls_assert ();
+      return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
+    }
   /* The value still has the previous tag's length bytes, plus the
    * current value's tag and length bytes. Decode them.
    */
 
-  ptr = elem->value;
-  remlen = elem->value_len;
+  ptr = vnode.value;
+  remlen = vnode.value_len;
   len = asn1_get_length_der (ptr, remlen, &lenlen);
   if (len < 0)
     {
@@ -2131,7 +2146,7 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
       }
     ava->value.size = tmp;
   }
-  ava->value.data = ptr + lenlen;
+  ava->value.data = (void*)(ptr + lenlen);
 
   return 0;
 }


hooks/post-receive
-- 
GNU gnutls



reply via email to

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