Просмотр исходного кода

Merge branch 'bugfix/ds_invalidate_assert_v4.3' into 'release/v4.3'

esp32s2 ds: Fix invalidating Digital Signature key from HMAC peripheral if assertions are disabled (v4.3)

See merge request espressif/esp-idf!12905
Angus Gratton 4 лет назад
Родитель
Сommit
e5437afa7f
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      components/esp32s2/esp_ds.c

+ 3 - 2
components/esp32s2/esp_ds.c

@@ -161,8 +161,9 @@ esp_err_t esp_ds_finish_sign(void *signature, esp_ds_context_t *esp_ds_ctx)
 
     free(esp_ds_ctx);
 
-    // should not fail if called with correct purpose
-    assert(ets_hmac_invalidate_downstream(ETS_EFUSE_KEY_PURPOSE_HMAC_DOWN_DIGITAL_SIGNATURE) == ETS_OK);
+    int res = ets_hmac_invalidate_downstream(ETS_EFUSE_KEY_PURPOSE_HMAC_DOWN_DIGITAL_SIGNATURE);
+    assert(res == ETS_OK); // should not fail if called with correct purpose
+    (void)res;
 
     ds_disable_release();