mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-24 08:16:33 +01:00
Fix and document corner-cases of time checking
This commit is contained in:
parent
57e10d71be
commit
e7e89844d6
2 changed files with 16 additions and 10 deletions
|
|
@ -922,7 +922,7 @@ int mbedtls_x509_time_is_past( const mbedtls_x509_time *to )
|
|||
mbedtls_x509_time now;
|
||||
|
||||
if( x509_get_current_time( &now ) != 0 )
|
||||
return( -1 );
|
||||
return( 1 );
|
||||
|
||||
return( x509_check_time( &now, to ) );
|
||||
}
|
||||
|
|
@ -932,7 +932,7 @@ int mbedtls_x509_time_is_future( const mbedtls_x509_time *from )
|
|||
mbedtls_x509_time now;
|
||||
|
||||
if( x509_get_current_time( &now ) != 0 )
|
||||
return( -1 );
|
||||
return( 1 );
|
||||
|
||||
return( x509_check_time( from, &now ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue