pk: store opaque key ID directly in the pk_context structure
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
71f88ecc52
commit
e00954d0ed
3 changed files with 19 additions and 31 deletions
|
@ -40,7 +40,7 @@
|
|||
#include "mbedtls/ecdsa.h"
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
#include "psa/crypto.h"
|
||||
#endif
|
||||
|
||||
|
@ -234,10 +234,17 @@ typedef struct mbedtls_pk_info_t mbedtls_pk_info_t;
|
|||
|
||||
/**
|
||||
* \brief Public key container
|
||||
*
|
||||
* \note The opaque_id is guarded by MBEDTLS_PSA_CRYPTO_C and not
|
||||
* only by MBEDTLS_USE_PSA_CRYPTO because it can be used also
|
||||
* in mbedtls_pk_sign_ext for RSA keys.
|
||||
*/
|
||||
typedef struct mbedtls_pk_context {
|
||||
const mbedtls_pk_info_t *MBEDTLS_PRIVATE(pk_info); /**< Public key information */
|
||||
void *MBEDTLS_PRIVATE(pk_ctx); /**< Underlying public key context */
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
mbedtls_svc_key_id_t MBEDTLS_PRIVATE(opaque_id); /**< Key ID for opaque keys */
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
} mbedtls_pk_context;
|
||||
|
||||
#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue