Browse Source

esp_crt_bundle: Allow verify_callback to correct BADCERT_BAD_MD

Jeff Epler 5 năm trước cách đây
mục cha
commit
a1d5fcfece
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      components/mbedtls/esp_crt_bundle/esp_crt_bundle.c

+ 4 - 1
components/mbedtls/esp_crt_bundle/esp_crt_bundle.c

@@ -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;
     }