1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Add x509_crt_check_key_usage()

This commit is contained in:
Manuel Pégourié-Gonnard
2014-04-09 09:50:03 +02:00
committed by Paul Bakker
parent 0f79babd4b
commit 603116c570
5 changed files with 85 additions and 0 deletions

View File

@ -316,6 +316,21 @@ void x509_oid_numstr( char *oid_str, char *numstr, int blen, int ret )
}
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_X509_CRT_PARSE_C */
void x509_check_key_usage( char *crt_file, int usage, int ret )
{
x509_crt crt;
x509_crt_init( &crt );
TEST_ASSERT( x509_crt_parse_file( &crt, crt_file ) == 0 );
TEST_ASSERT( x509_crt_check_key_usage( &crt, usage ) == ret );
x509_crt_free( &crt );
}
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_X509_CRT_PARSE_C:POLARSSL_SELF_TEST */
void x509_selftest()
{