This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 75bf1769a79eca4c708ede8a7c8425b631dacda7
Author: makejian <[email protected]>
AuthorDate: Wed Nov 25 11:48:06 2026 +0800

    crypto/mbedtls: add PSA secure element and ITS prefix options
    
    Add two more Mbed TLS options to the Kconfig so they can be selected
    from NuttX:
    
    - MBEDTLS_PSA_CRYPTO_SE_C enables the dynamic secure element support
      of the PSA cryptography API, the framework that secure element
      drivers register against.
    - PSA_ITS_STORAGE_PREFIX moves the PSA key files out of the current
      working directory, which is where the ITS file backend keeps them
      otherwise.
    
    Both options map one to one onto the upstream Mbed TLS options of the
    same names.
    
    Testing
    -------
    Built sim:nsh with CONFIG_CRYPTO_MBEDTLS and the PSA options enabled:
    the Mbed TLS library, including library/psa_crypto_se.c that the new
    option gates, compiles with 0 warnings; the crypto driver tests and
    the PKCS12 wrapper test stay green.
    
    Signed-off-by: makejian <[email protected]>
---
 crypto/mbedtls/Kconfig                          | 10 ++++++++++
 crypto/mbedtls/include/mbedtls/mbedtls_config.h | 18 +++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/crypto/mbedtls/Kconfig b/crypto/mbedtls/Kconfig
index db1f1fbb3..f4e80ff06 100644
--- a/crypto/mbedtls/Kconfig
+++ b/crypto/mbedtls/Kconfig
@@ -622,10 +622,20 @@ config MBEDTLS_PSA_CRYPTO_STORAGE_C
        depends on MBEDTLS_PSA_CRYPTO_C
        default !MBEDTLS_MINIMAL
 
+config MBEDTLS_PSA_CRYPTO_SE_C
+       bool "Enable dynamic secure element support in the Platform Security 
Architecture cryptography API."
+       depends on MBEDTLS_PSA_CRYPTO_C && MBEDTLS_PSA_CRYPTO_STORAGE_C
+       default n
+
 config MBEDTLS_PSA_ITS_FILE_C
        bool "Enable the emulation of the Platform Security Architecture 
Internal Trusted Storage (PSA ITS) over files."
        default !MBEDTLS_MINIMAL
 
+config PSA_ITS_STORAGE_PREFIX
+       string "Allows storing the key files in a directory other than the 
current directory."
+       depends on MBEDTLS_PSA_ITS_FILE_C
+       default ""
+
 config MBEDTLS_RIPEMD160_C
        bool "Enable the RIPEMD-160 hash algorithm."
        default !MBEDTLS_MINIMAL
diff --git a/crypto/mbedtls/include/mbedtls/mbedtls_config.h 
b/crypto/mbedtls/include/mbedtls/mbedtls_config.h
index b351000c9..3479e1819 100644
--- a/crypto/mbedtls/include/mbedtls/mbedtls_config.h
+++ b/crypto/mbedtls/include/mbedtls/mbedtls_config.h
@@ -3741,7 +3741,9 @@
  *
  */
 
-/* #define MBEDTLS_PSA_CRYPTO_SE_C */
+#ifdef CONFIG_MBEDTLS_PSA_CRYPTO_SE_C
+#define MBEDTLS_PSA_CRYPTO_SE_C
+#endif
 
 /**
  * \def MBEDTLS_PSA_CRYPTO_STORAGE_C
@@ -3772,6 +3774,20 @@
 #define MBEDTLS_PSA_ITS_FILE_C
 #endif
 
+/**
+ * \def PSA_ITS_STORAGE_PREFIX
+ *
+ * Allows storing the key files in a directory other than the current
+ * directory.
+ *
+ * Module:  library/psa_its_file.c
+ *
+ * Requires: MBEDTLS_PSA_ITS_FILE_C
+ */
+#ifdef CONFIG_PSA_ITS_STORAGE_PREFIX
+#define PSA_ITS_STORAGE_PREFIX CONFIG_PSA_ITS_STORAGE_PREFIX
+#endif
+
 /**
  * \def MBEDTLS_RIPEMD160_C
  *

Reply via email to