summaryrefslogtreecommitdiff
path: root/lib/decoding.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-05 15:02:11 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-05-18 17:47:17 +0200
commitf21c3ce53b9e6648b158cf25da60976e7041f072 (patch)
tree44e561351bad3a646f86e1fd3cc22fdf059def76 /lib/decoding.c
parent42ca3d7dd0854a77909935330adf7648aa3c8453 (diff)
downloadlibtasn1-f21c3ce53b9e6648b158cf25da60976e7041f072.tar.gz
decoding: added flag ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME
This flag allows decoding errors in time fields even when in strict DER mode. That is introduced in order to allow toleration of invalid times in certificates (which are common) even though strict DER adherence is enforced in other fields. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/decoding.c')
-rw-r--r--lib/decoding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index fcf3aff..2240b09 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -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++)