mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
soc/esp_ds.h: Unify esp_ds error codes for all targets
This commit is contained in:
@@ -119,7 +119,7 @@ esp_err_t esp_ds_start_sign(const void *message,
|
||||
uint32_t conf_error = hmac_hal_configure(HMAC_OUTPUT_DS, key_id);
|
||||
if (conf_error) {
|
||||
ds_disable_release();
|
||||
return ESP32S3_ERR_HW_CRYPTO_DS_HMAC_FAIL;
|
||||
return ESP_ERR_HW_CRYPTO_DS_HMAC_FAIL;
|
||||
}
|
||||
|
||||
ds_hal_start();
|
||||
@@ -129,7 +129,7 @@ esp_err_t esp_ds_start_sign(const void *message,
|
||||
while (ds_ll_busy() != 0) {
|
||||
if ((esp_timer_get_time() - start_time) > SOC_DS_KEY_CHECK_MAX_WAIT_US) {
|
||||
ds_disable_release();
|
||||
return ESP32S3_ERR_HW_CRYPTO_DS_INVALID_KEY;
|
||||
return ESP_ERR_HW_CRYPTO_DS_INVALID_KEY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,11 +174,11 @@ esp_err_t esp_ds_finish_sign(void *signature, esp_ds_context_t *esp_ds_ctx)
|
||||
esp_err_t return_value = ESP_OK;
|
||||
|
||||
if (sig_check_result == DS_SIGNATURE_MD_FAIL || sig_check_result == DS_SIGNATURE_PADDING_AND_MD_FAIL) {
|
||||
return_value = ESP32S3_ERR_HW_CRYPTO_DS_INVALID_DIGEST;
|
||||
return_value = ESP_ERR_HW_CRYPTO_DS_INVALID_DIGEST;
|
||||
}
|
||||
|
||||
if (sig_check_result == DS_SIGNATURE_PADDING_FAIL) {
|
||||
return_value = ESP32S3_ERR_HW_CRYPTO_DS_INVALID_PADDING;
|
||||
return_value = ESP_ERR_HW_CRYPTO_DS_INVALID_PADDING;
|
||||
}
|
||||
|
||||
free(esp_ds_ctx);
|
||||
|
Reference in New Issue
Block a user