mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-27 15:35:50 +00:00
Only run X.509 CRT verification tests with CA callback tests if !CRL
This commit is contained in:
parent
cbb590369c
commit
0350d56286
@ -440,12 +440,17 @@ void x509_verify( char *crt_file, char *ca_file, char *crl_file,
|
|||||||
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
|
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
|
||||||
|
|
||||||
#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)
|
#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)
|
||||||
flags = 0;
|
/* CRLs aren't supported with CA callbacks, so skip the CA callback
|
||||||
|
* version of the test of CRLs are in use. */
|
||||||
|
if( crl_file == NULL || strcmp( crl_file, "" ) == 0 )
|
||||||
|
{
|
||||||
|
flags = 0;
|
||||||
|
|
||||||
res = mbedtls_x509_crt_verify_with_cb( &crt, ca_callback, &ca, profile, cn_name, &flags, f_vrfy, NULL );
|
res = mbedtls_x509_crt_verify_with_cb( &crt, ca_callback, &ca, profile, cn_name, &flags, f_vrfy, NULL );
|
||||||
|
|
||||||
TEST_ASSERT( res == ( result ) );
|
TEST_ASSERT( res == ( result ) );
|
||||||
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
|
TEST_ASSERT( flags == (uint32_t)( flags_result ) );
|
||||||
|
}
|
||||||
#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */
|
#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */
|
||||||
exit:
|
exit:
|
||||||
mbedtls_x509_crt_free( &crt );
|
mbedtls_x509_crt_free( &crt );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user