Apply patches to openvpn3 dependencies

This commit is contained in:
Sergey Abramchuk
2020-03-04 11:57:35 +03:00
parent 1e77a600a4
commit 6b782a9309
15 changed files with 212 additions and 18 deletions
+17 -1
View File
@@ -564,13 +564,20 @@ static int x509_parse_time( unsigned char **p, size_t len, size_t yearlen,
/*
* Parse seconds if present
*/
if ( len >= 2 )
if ( len >= 2 && **p >= '0' && **p <= '9' )
{
CHECK( x509_parse_int( p, 2, &tm->sec ) );
len -= 2;
}
else
{
#if defined(MBEDTLS_RELAXED_X509_DATE)
/* if relaxed mode, allow seconds to be absent */
tm->sec = 0;
#else
return ( MBEDTLS_ERR_X509_INVALID_DATE );
#endif
}
/*
* Parse trailing 'Z' if present
@@ -580,6 +587,15 @@ static int x509_parse_time( unsigned char **p, size_t len, size_t yearlen,
(*p)++;
len--;
}
#if defined(MBEDTLS_RELAXED_X509_DATE)
else if ( len == 5 && **p == '+' )
{
int tz; /* throwaway timezone */
(*p)++;
CHECK( x509_parse_int( p, 4, &tz ) );
return 0;
}
#endif
/*
* We should have parsed all characters at this point