mirror of https://github.com/ARMmbed/mbed-os.git
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.pull/14333/head
parent
12b2c89962
commit
eb0ac59494
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
#include "crypto_compat.h"
|
#include "crypto_compat.h"
|
||||||
|
|
||||||
|
#include "platform/mbed_toolchain.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,15 +56,17 @@ extern "C" {
|
||||||
* for, in addition to the algorithm set with
|
* for, in addition to the algorithm set with
|
||||||
* psa_set_key_algorithm().
|
* psa_set_key_algorithm().
|
||||||
*
|
*
|
||||||
* \warning Setting an enrollment algorithm is not recommended, because
|
* \deprecated This is for backward compatibility only.
|
||||||
* using the same key with different algorithms can allow some
|
* Setting an enrollment algorithm is not recommended, because
|
||||||
* attacks based on arithmetic relations between different
|
* using the same key with different algorithms can allow some
|
||||||
* computations made with the same key, or can escalate harmless
|
* attacks based on arithmetic relations between different
|
||||||
* side channels into exploitable ones. Use this function only
|
* computations made with the same key, or can escalate harmless
|
||||||
* if it is necessary to support a protocol for which it has been
|
* side channels into exploitable ones. Use this function only
|
||||||
* verified that the usage of the key with multiple algorithms
|
* if it is necessary to support a protocol for which it has been
|
||||||
* is safe.
|
* verified that the usage of the key with multiple algorithms
|
||||||
|
* is safe.
|
||||||
*/
|
*/
|
||||||
|
MBED_DEPRECATED("Setting enrollment algorithm is for backward compatibility and not recommended.")
|
||||||
static inline void psa_set_key_enrollment_algorithm(
|
static inline void psa_set_key_enrollment_algorithm(
|
||||||
psa_key_attributes_t *attributes,
|
psa_key_attributes_t *attributes,
|
||||||
psa_algorithm_t alg2)
|
psa_algorithm_t alg2)
|
||||||
|
@ -75,7 +79,10 @@ static inline void psa_set_key_enrollment_algorithm(
|
||||||
* \param[in] attributes The key attribute structure to query.
|
* \param[in] attributes The key attribute structure to query.
|
||||||
*
|
*
|
||||||
* \return The enrollment algorithm stored in the attribute structure.
|
* \return The enrollment algorithm stored in the attribute structure.
|
||||||
|
* \deprecated This is for backward compatibility only.
|
||||||
|
* Deprecated along with psa_set_key_enrollment_algorithm().
|
||||||
*/
|
*/
|
||||||
|
MBED_DEPRECATED("Getting enrollment algorithm is for backward compatibility and not recommended.")
|
||||||
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
|
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
|
||||||
const psa_key_attributes_t *attributes)
|
const psa_key_attributes_t *attributes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
#include "psa/crypto_compat.h"
|
#include "psa/crypto_compat.h"
|
||||||
|
|
||||||
|
#include "platform/mbed_toolchain.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -145,6 +147,7 @@ static inline psa_ecc_family_t mbedtls_ecc_group_to_psa( mbedtls_ecp_group_id gr
|
||||||
* verified that the usage of the key with multiple algorithms
|
* verified that the usage of the key with multiple algorithms
|
||||||
* is safe.
|
* is safe.
|
||||||
*/
|
*/
|
||||||
|
MBED_DEPRECATED("Setting enrollment algorithm is for backward compatibility and not recommended.")
|
||||||
static inline void psa_set_key_enrollment_algorithm(
|
static inline void psa_set_key_enrollment_algorithm(
|
||||||
psa_key_attributes_t *attributes,
|
psa_key_attributes_t *attributes,
|
||||||
psa_algorithm_t alg2)
|
psa_algorithm_t alg2)
|
||||||
|
@ -161,6 +164,7 @@ static inline void psa_set_key_enrollment_algorithm(
|
||||||
* \deprecated This is for backward compatibility only.
|
* \deprecated This is for backward compatibility only.
|
||||||
* Deprecated along with psa_set_key_enrollment_algorithm().
|
* Deprecated along with psa_set_key_enrollment_algorithm().
|
||||||
*/
|
*/
|
||||||
|
MBED_DEPRECATED("Getting enrollment algorithm is for backward compatibility and not recommended.")
|
||||||
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
|
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
|
||||||
const psa_key_attributes_t *attributes)
|
const psa_key_attributes_t *attributes)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue