[gnutls-devel] GnuTLS | Do not tolerate invalid DER time (!1141)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Dec 26 19:24:45 CET 2019




Nikos Mavrogiannopoulos commented on a discussion on lib/x509/common.h: https://gitlab.com/gnutls/gnutls/merge_requests/1141#note_265162592

>  inline static int _asn1_strict_der_decode (asn1_node * element, const void *ider,
>  		       int len, char *errorDescription)
>  {
> -#ifdef ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME
> -# define _ASN1_DER_FLAGS ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME|ASN1_DECODE_FLAG_STRICT_DER
> -#else
> +#if defined(STRICT_DER_TIME) || !defined(ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME)
>  # define _ASN1_DER_FLAGS ASN1_DECODE_FLAG_STRICT_DER
> +#else
> +# define _ASN1_DER_FLAGS ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME|ASN1_DECODE_FLAG_STRICT_DER

Isn't what the final code has? I see the parenthesis in the second define.
```
#if defined(STRICT_DER_TIME) || !defined(ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME)
# define _ASN1_DER_FLAGS ASN1_DECODE_FLAG_STRICT_DER
#else
# define _ASN1_DER_FLAGS (ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME|ASN1_DECODE_FLAG_STRICT_DER)
#endif
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1141#note_265162592
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20191226/89fbecab/attachment-0001.html>


More information about the Gnutls-devel mailing list