Merge pull request #5827 from wernerlewis/time_utc
Use ASN1 UTC tags for dates before 2000
This commit is contained in:
commit
11930699f1
4 changed files with 72 additions and 3 deletions
|
@ -324,7 +324,7 @@ static int x509_write_time( unsigned char **p, unsigned char *start,
|
|||
/*
|
||||
* write MBEDTLS_ASN1_UTC_TIME if year < 2050 (2 bytes shorter)
|
||||
*/
|
||||
if( t[0] == '2' && t[1] == '0' && t[2] < '5' )
|
||||
if( t[0] < '2' || ( t[0] == '2' && t[1] == '0' && t[2] < '5' ) )
|
||||
{
|
||||
MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_raw_buffer( p, start,
|
||||
(const unsigned char *) t + 2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue