Merge branch 'feat/support_persistent_esp_rsa_ds_keys_v6.0' into 'release/v6.0'

Support persistent ESP RSA DS keys (v6.0)

See merge request espressif/esp-idf!48523
This commit is contained in:
Jiang Jiang Jian
2026-05-15 15:46:46 +08:00
86 changed files with 1116 additions and 92 deletions
+11 -2
View File
@@ -113,8 +113,17 @@ To use the DS peripheral for signing or decryption in application code (outside
psa_destroy_key(key_id);
Example for SSL Mutual Authentication Using DS
----------------------------------------------
Persistent vs. Volatile RSA_DS PSA Keys
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The driver supports two PSA key lifetimes for RSA_DS keys:
- ``PSA_KEY_LIFETIME_ESP_RSA_DS_VOLATILE`` (used in the example above) stores only pointers to the caller-supplied ``esp_ds_data_ctx_t`` and any Key Manager recovery info in the PSA key slot. The referenced buffers must remain valid until :cpp:func:`psa_destroy_key` is called. This avoids deep-copying large blobs such as :cpp:type:`esp_ds_data_t` (≈1200-1600 bytes, chip-dependent) when they already live in mmap'd flash via ``esp_secure_cert_mgr``.
- ``PSA_KEY_LIFETIME_ESP_RSA_DS`` (persistent) deep-copies the encrypted key material into the PSA key slot at :cpp:func:`psa_import_key` time and PSA persists it to NVS together with the rest of the key attributes. The caller is free to release the import-time buffers once :cpp:func:`psa_import_key` returns; subsequent :cpp:func:`psa_sign_hash` / :cpp:func:`psa_asymmetric_decrypt` calls retrieve the bytes back from NVS automatically. Use this lifetime when the application wants the key to survive reboots without having to reload the ``esp_ds_data_ctx_t`` from external storage on every boot.
Example for SSL Mutual Authentication Using RSA_DS
---------------------------------------------------
The SSL mutual authentication example that previously lived under ``examples/protocols/mqtt/ssl_ds`` is now shipped with the standalone `espressif/mqtt <https://components.espressif.com/components/espressif/mqtt>`__ component. Follow the component documentation to fetch the SSL DS example and build it together with ESP-MQTT. The example continues to use ``mqtt_client`` (implemented by ESP-MQTT) to connect to ``test.mosquitto.org`` over mutual-authenticated TLS, with the TLS portion handled by ESP-TLS.
+1 -1
View File
@@ -175,7 +175,7 @@ Flash Encryption Best Practices
* - High
- 72.4 %
.. [#] The above performance numbers have been calculated using the AES performance test of the mbedtls test application :component_file:`test_psa_aes_perf.c <mbedtls/test_apps/main/test_psa_aes_perf.c>`.
.. [#] The above performance numbers have been calculated using the AES performance test of the mbedtls test application :component_file:`test_psa_aes_perf.c <mbedtls/test_apps/mbedtls_ut/main/test_psa_aes_perf.c>`.
Considering the above performance impact, ESP-IDF by-default does not enable the pseudo-round function to avoid any performance-related degrade. But it is recommended to enable the pseudo-round function for better security.