esp_crt_bundle: Allow verify_callback to correct BADCERT_BAD_MD

This commit is contained in:
Jeff Epler
2020-11-13 14:42:07 -06:00
committed by Marius Vikhammer
parent 820e092a8d
commit a79cb9f8cd

View File

@@ -97,7 +97,10 @@ int esp_crt_verify_callback(void *buf, mbedtls_x509_crt *crt, int data, uint32_t
{
mbedtls_x509_crt *child = crt;
if (*flags != MBEDTLS_X509_BADCERT_NOT_TRUSTED) {
if (!*flags) {
return 0;
}
if (*flags & ~(MBEDTLS_X509_BADCERT_NOT_TRUSTED | MBEDTLS_X509_BADCERT_BAD_MD)) {
return 0;
}