[config] default enable "key references" with PSA crypto (#12877)

This commit updates the default value of the
`OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` configuration
to be enabled automatically when `OPENTHREAD_CONFIG_CRYPTO_LIB` is
set to `OPENTHREAD_CONFIG_CRYPTO_LIB_PSA`. Additionally, it adds a
compile-time check in `crypto_platform_psa.cpp` to enforce this
requirement. This ensures that the platform key references support is
always enabled when the PSA crypto library is selected.
This commit is contained in:
Abtin Keshavarzian
2026-04-10 21:39:12 -05:00
committed by GitHub
parent 581221eedb
commit 0d740686f3
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -34,6 +34,7 @@
#ifndef OT_CORE_CONFIG_PLATFORM_H_
#define OT_CORE_CONFIG_PLATFORM_H_
#include "config/crypto.h"
#include "config/srp_server.h"
/**
@@ -156,7 +157,8 @@
* Define to 1 if you want to enable key ref usage support as defined by platform.
*/
#ifndef OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
#define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 0
#define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE \
(OPENTHREAD_CONFIG_CRYPTO_LIB == OPENTHREAD_CONFIG_CRYPTO_LIB_PSA)
#endif
/**
+4
View File
@@ -58,6 +58,10 @@ using namespace Crypto;
#if OPENTHREAD_CONFIG_CRYPTO_LIB == OPENTHREAD_CONFIG_CRYPTO_LIB_PSA
#if !OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
#error "`OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` is required when `CONFIG_CRYPTO_LIB_PSA` is selected"
#endif
//---------------------------------------------------------------------------------------------------------------------
// Default/weak implementation of crypto platform APIs