From 79ae5b68e723de81146a11a9e61906dc8e03bb50 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 25 Feb 2019 18:12:00 +0000 Subject: [PATCH] Make use of CRT acquire/release in x509_serial_is_revoked() --- library/x509_crt.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index d7abb9b3f..bd3a7da21 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -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 ); } /*