libtasn1-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libtasn1 branch, master, updated. libtasn1_4_1-6-g30daf91


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4_1-6-g30daf91
Date: Thu, 04 Sep 2014 08:24:41 +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 libtasn1".

http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=30daf9162f72cf8c496bd43ab35fc64d4296da65

The branch, master has been updated
       via  30daf9162f72cf8c496bd43ab35fc64d4296da65 (commit)
       via  9e832a6d5072263a1fea554c654e29ccf918e059 (commit)
       via  14a5a48f472064c4e9bb43b1b8292ff9dd9064f4 (commit)
      from  e91cb99ce0b2e01b0ea1ec9e57415f0e2064560c (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 30daf9162f72cf8c496bd43ab35fc64d4296da65
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 4 10:24:36 2014 +0200

    doc update

commit 9e832a6d5072263a1fea554c654e29ccf918e059
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 4 10:18:34 2014 +0200

    corrected regression which caused the failure of octet string extraction
    
    This affected octet strings placed at the end of the structure.
    Fixes issue with OCSP response parsing in gnutls.

commit 14a5a48f472064c4e9bb43b1b8292ff9dd9064f4
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 4 10:18:07 2014 +0200

    added more warnings

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

Summary of changes:
 NEWS           |    2 ++
 lib/decoding.c |   23 ++++++++++++++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index c4ad461..d8d2563 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ GNU Libtasn1 NEWS                                     -*- 
outline -*-
 
 * Noteworthy changes in release 4.2 (unreleased) [stable]
 - Added sanity checks in the decoding of time
+- Fixes in the decoding of OCTET STRING when close to the end
+  of the structure.
 
 * Noteworthy changes in release 4.1 (released 2014-08-23) [stable]
 - Corrected indefinite tag check in ANY constructions. That allows
diff --git a/lib/decoding.c b/lib/decoding.c
index 9622fda..0b5bd10 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -778,6 +778,7 @@ _asn1_get_octet_string (asn1_node node, const unsigned char 
*der, int der_len,
 {
   int len2, len3, counter, tot_len, indefinite;
   int result;
+  int orig_der_len = der_len;
 
   counter = 0;
 
@@ -814,13 +815,19 @@ _asn1_get_octet_string (asn1_node node, const unsigned 
char *der, int der_len,
 
           DECR_LEN(der_len, 1);
          if (der[counter] != ASN1_TAG_OCTET_STRING)
-           return ASN1_DER_ERROR;
+           {
+             warn();
+             return ASN1_DER_ERROR;
+           }
 
          counter++;
 
          len2 = asn1_get_length_der (der + counter, der_len, &len3);
          if (len2 <= 0)
-           return ASN1_DER_ERROR;
+           {
+             warn();
+             return ASN1_DER_ERROR;
+           }
 
           DECR_LEN(der_len, len3 + len2);
          counter += len3 + len2;
@@ -839,9 +846,12 @@ _asn1_get_octet_string (asn1_node node, const unsigned 
char *der, int der_len,
          asn1_length_der (tot_len, temp, &len2);
          _asn1_set_value (node, temp, len2);
 
-         ret = _asn1_extract_der_octet (node, der, der_len, flags);
+         ret = _asn1_extract_der_octet (node, der, orig_der_len, flags);
          if (ret != ASN1_SUCCESS)
-           return ret;
+           {
+             warn();
+             return ret;
+           }
 
        }
     }
@@ -849,7 +859,10 @@ _asn1_get_octet_string (asn1_node node, const unsigned 
char *der, int der_len,
     {                          /* NOT STRUCTURED */
       len2 = asn1_get_length_der (der, der_len, &len3);
       if (len2 < 0)
-       return ASN1_DER_ERROR;
+        {
+          warn();
+         return ASN1_DER_ERROR;
+       }
 
       DECR_LEN(der_len, len3+len2);
       counter = len3 + len2;


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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