Skip to content

Commit eb0ac59

Browse files
committed
Deprecation warnings for key enrollment algorithm
Setting/getting key enrollment algorithm is not recommended and not part of the vanilla PSA or TF-M. For now keep the API just for backward compatibility with existing projects, and this commit adds deprecation warnings.
1 parent 12b2c89 commit eb0ac59

File tree

2 files changed

+19
-8
lines changed
  • platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA

2 files changed

+19
-8
lines changed

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/inc/psa/crypto_extra.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
#include "crypto_compat.h"
3434

35+
#include "platform/mbed_toolchain.h"
36+
3537
#ifdef __cplusplus
3638
extern "C" {
3739
#endif
@@ -54,15 +56,17 @@ extern "C" {
5456
* for, in addition to the algorithm set with
5557
* psa_set_key_algorithm().
5658
*
57-
* \warning Setting an enrollment algorithm is not recommended, because
58-
* using the same key with different algorithms can allow some
59-
* attacks based on arithmetic relations between different
60-
* computations made with the same key, or can escalate harmless
61-
* side channels into exploitable ones. Use this function only
62-
* if it is necessary to support a protocol for which it has been
63-
* verified that the usage of the key with multiple algorithms
64-
* is safe.
59+
* \deprecated This is for backward compatibility only.
60+
* Setting an enrollment algorithm is not recommended, because
61+
* using the same key with different algorithms can allow some
62+
* attacks based on arithmetic relations between different
63+
* computations made with the same key, or can escalate harmless
64+
* side channels into exploitable ones. Use this function only
65+
* if it is necessary to support a protocol for which it has been
66+
* verified that the usage of the key with multiple algorithms
67+
* is safe.
6568
*/
69+
MBED_DEPRECATED("Setting enrollment algorithm is for backward compatibility and not recommended.")
6670
static inline void psa_set_key_enrollment_algorithm(
6771
psa_key_attributes_t *attributes,
6872
psa_algorithm_t alg2)
@@ -75,7 +79,10 @@ static inline void psa_set_key_enrollment_algorithm(
7579
* \param[in] attributes The key attribute structure to query.
7680
*
7781
* \return The enrollment algorithm stored in the attribute structure.
82+
* \deprecated This is for backward compatibility only.
83+
* Deprecated along with psa_set_key_enrollment_algorithm().
7884
*/
85+
MBED_DEPRECATED("Getting enrollment algorithm is for backward compatibility and not recommended.")
7986
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
8087
const psa_key_attributes_t *attributes)
8188
{

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/include/psa/crypto_extra.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include "psa/crypto_compat.h"
2222

23+
#include "platform/mbed_toolchain.h"
24+
2325
#ifdef __cplusplus
2426
extern "C" {
2527
#endif
@@ -145,6 +147,7 @@ static inline psa_ecc_family_t mbedtls_ecc_group_to_psa( mbedtls_ecp_group_id gr
145147
* verified that the usage of the key with multiple algorithms
146148
* is safe.
147149
*/
150+
MBED_DEPRECATED("Setting enrollment algorithm is for backward compatibility and not recommended.")
148151
static inline void psa_set_key_enrollment_algorithm(
149152
psa_key_attributes_t *attributes,
150153
psa_algorithm_t alg2)
@@ -161,6 +164,7 @@ static inline void psa_set_key_enrollment_algorithm(
161164
* \deprecated This is for backward compatibility only.
162165
* Deprecated along with psa_set_key_enrollment_algorithm().
163166
*/
167+
MBED_DEPRECATED("Getting enrollment algorithm is for backward compatibility and not recommended.")
164168
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
165169
const psa_key_attributes_t *attributes)
166170
{

0 commit comments

Comments
 (0)