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-8-ga9a74e4


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4_1-8-ga9a74e4
Date: Mon, 15 Sep 2014 14:05:16 +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=a9a74e409439088f1d74c1ab51e8f2013a0e020e

The branch, master has been updated
       via  a9a74e409439088f1d74c1ab51e8f2013a0e020e (commit)
      from  745392ae2a8a97cdd6df583698a959eb3b8553c2 (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 a9a74e409439088f1d74c1ab51e8f2013a0e020e
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Sep 15 16:04:57 2014 +0200

    enforce the new time tests only in strict DER mode

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

Summary of changes:
 lib/decoding.c |   54 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/lib/decoding.c b/lib/decoding.c
index cdf0b85..e206b93 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -302,41 +302,43 @@ _asn1_get_time_der (unsigned type, const unsigned char 
*der, int der_len, int *r
       return ASN1_DER_ERROR;
     }
 
-  p = &der[len_len];
-  for (i=0;i<(unsigned)(str_len-1);i++)
-     {
-       if (isdigit(p[i]) == 0)
+  if (flags & ASN1_DECODE_FLAG_STRICT_DER)
+    {
+      p = &der[len_len];
+      for (i=0;i<(unsigned)(str_len-1);i++)
          {
-           if (type == ASN1_ETYPE_GENERALIZED_TIME)
+           if (isdigit(p[i]) == 0)
              {
-               /* tolerate lax encodings */
-               if (p[i] == '.' && dot_count == 0)
+               if (type == ASN1_ETYPE_GENERALIZED_TIME)
                  {
-                   dot_count++;
-                   continue;
+                   /* tolerate lax encodings */
+                   if (p[i] == '.' && dot_count == 0)
+                     {
+                       dot_count++;
+                       continue;
+                     }
+
+               /* This is not really valid DER, but there are
+                * structures using that */
+                   if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) &&
+                       (p[i] == '+' || p[i] == '-') && sign_count == 0)
+                     {
+                       sign_count++;
+                       continue;
+                     }
                  }
 
-              /* This is not really valid DER, but there are
-               * structures using that */
-               if (!(flags & ASN1_DECODE_FLAG_STRICT_DER) &&
-                   (p[i] == '+' || p[i] == '-') && sign_count == 0)
-                 {
-                   sign_count++;
-                   continue;
-                 }
+               warn();
+           return ASN1_DER_ERROR;
              }
-
-           warn();
-          return ASN1_DER_ERROR;
          }
-     }
 
-  if (sign_count == 0 && p[str_len-1] != 'Z')
-    {
-      warn();
-      return ASN1_DER_ERROR;
+      if (sign_count == 0 && p[str_len-1] != 'Z')
+        {
+          warn();
+          return ASN1_DER_ERROR;
+        }
     }
-
   memcpy (str, der + len_len, str_len);
   str[str_len] = 0;
   *ret_len = str_len + len_len;


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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