]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
libtasn1: updated to 4.11
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 27 May 2017 05:29:44 +0000 (07:29 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 27 May 2017 06:29:50 +0000 (08:29 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lib/minitasn1/decoding.c
lib/minitasn1/libtasn1.h
lib/minitasn1/parser_aux.c

index fcf3aff0a37f2708e8cfa4c012cf789eb9691f6a..2240b09406364c9d2bce9c34bc230a1e7cdee6ff 100644 (file)
@@ -332,7 +332,7 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r
       return ASN1_TIME_ENCODING_ERROR;
     }
 
-  if (flags & ASN1_DECODE_FLAG_STRICT_DER)
+  if ((flags & ASN1_DECODE_FLAG_STRICT_DER) && !(flags & ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME))
     {
       p = &der[len_len];
       for (i=0;i<(unsigned)(str_len-1);i++)
index 0d6203d2738d3b3c5975651d88c386276f98ffd3..4ee4c54e60111966de3507348ad90195e143a396 100644 (file)
@@ -44,7 +44,7 @@ extern "C"
 {
 #endif
 
-#define ASN1_VERSION "4.10"
+#define ASN1_VERSION "4.11"
 
 #if defined(__GNUC__) && !defined(ASN1_INTERNAL_BUILD)
 # define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
@@ -191,6 +191,8 @@ extern "C"
 #define ASN1_DECODE_FLAG_ALLOW_PADDING 1
 /* This flag would ensure that no BER decoding takes place */
 #define ASN1_DECODE_FLAG_STRICT_DER (1<<1)
+/* This flag will tolerate Time encoding errors when in strict DER */
+#define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2)
 
 
   struct asn1_data_node_st
index b4a7370b9b7516239fd471c818c6e276423f4e6f..976ab38f1863845c03ed5730d91ebe0113348f79 100644 (file)
@@ -120,6 +120,9 @@ asn1_find_node (asn1_node pointer, const char *name)
       if (n_end)
        {
          nsize = n_end - n_start;
+         if (nsize >= sizeof(n))
+               return NULL;
+
          memcpy (n, n_start, nsize);
          n[nsize] = 0;
          n_start = n_end;
@@ -158,6 +161,9 @@ asn1_find_node (asn1_node pointer, const char *name)
       if (n_end)
        {
          nsize = n_end - n_start;
+         if (nsize >= sizeof(n))
+               return NULL;
+
          memcpy (n, n_start, nsize);
          n[nsize] = 0;
          n_start = n_end;