[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 13:18:32 CET 2019




Tim Rühsen commented on a discussion on lib/x509/common.h: https://gitlab.com/gnutls/gnutls/merge_requests/1141#note_265075928

>  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

Sorry for being not precise - I meant
```
# define _ASN1_DER_FLAGS (ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME | ASN1_DECODE_FLAG_STRICT_DER)
```

Because `&` and others have precedence over `|`, using `_ASN1_DER_FLAGS` might cause unwanted behavior and hard to find bugs under certain conditions.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1141#note_265075928
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/6903b50c/attachment.html>


More information about the Gnutls-devel mailing list