Make use of CRT acquire/release in x509_serial_is_revoked()

This commit is contained in:
Hanno Becker 2019-02-25 18:12:00 +00:00
parent e9718b451a
commit 79ae5b68e7

View file

@ -2228,9 +2228,18 @@ static int x509_serial_is_revoked( unsigned char const *serial,
int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt *crt,
const mbedtls_x509_crl *crl )
{
return( x509_serial_is_revoked( crt->serial.p,
crt->serial.len,
crl ) );
int ret;
mbedtls_x509_crt_frame *frame;
ret = x509_crt_frame_acquire( crt, &frame );
if( ret != 0 )
return( MBEDTLS_ERR_X509_FATAL_ERROR );
ret = x509_serial_is_revoked( frame->serial.p,
frame->serial.len,
crl );
x509_crt_frame_release( crt, frame );
return( ret );
}
/*