From a7a646986f90a38fb19a762133d5cc065bbcda1f Mon Sep 17 00:00:00 2001 From: pespacek Date: Mon, 14 Feb 2022 15:18:43 +0100 Subject: [PATCH] Improving readability Signed-off-by: pespacek --- library/x509_crt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index c12685d1e..14bedddbb 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -2384,6 +2384,11 @@ static int x509_crt_verifycrl( mbedtls_x509_crt *crt, mbedtls_x509_crt *ca, hash, sizeof( hash ), &hash_length ) != PSA_SUCCESS ) + { + /* Note: this can't happen except after an internal error */ + flags |= MBEDTLS_X509_BADCRL_NOT_TRUSTED; + break; + } #else md_info = mbedtls_md_info_from_type( crl_list->sig_md ); hash_length = mbedtls_md_get_size( md_info ); @@ -2391,12 +2396,13 @@ static int x509_crt_verifycrl( mbedtls_x509_crt *crt, mbedtls_x509_crt *ca, crl_list->tbs.p, crl_list->tbs.len, hash ) != 0 ) -#endif /* MBEDTLS_USE_PSA_CRYPTO */ { /* Note: this can't happen except after an internal error */ flags |= MBEDTLS_X509_BADCRL_NOT_TRUSTED; break; } +#endif /* MBEDTLS_USE_PSA_CRYPTO */ + if( x509_profile_check_key( profile, &ca->pk ) != 0 ) flags |= MBEDTLS_X509_BADCERT_BAD_KEY;