Only use mbedtls_ecc_group_of_psa if defined(MBEDTLS_ECP_LIGHT)
Signed-off-by: Jethro Beekman <jethro@fortanix.com>
This commit is contained in:
parent
33a3ccd899
commit
13d415c4ed
1 changed files with 6 additions and 1 deletions
|
@ -216,7 +216,9 @@ int mbedtls_pk_write_pubkey_der(const mbedtls_pk_context *key, unsigned char *bu
|
||||||
int has_par = 1;
|
int has_par = 1;
|
||||||
size_t len = 0, par_len = 0, oid_len = 0;
|
size_t len = 0, par_len = 0, oid_len = 0;
|
||||||
mbedtls_pk_type_t pk_type;
|
mbedtls_pk_type_t pk_type;
|
||||||
|
#if defined(MBEDTLS_ECP_LIGHT)
|
||||||
mbedtls_ecp_group_id ec_grp_id;
|
mbedtls_ecp_group_id ec_grp_id;
|
||||||
|
#endif
|
||||||
const char *oid;
|
const char *oid;
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
|
@ -264,6 +266,7 @@ int mbedtls_pk_write_pubkey_der(const mbedtls_pk_context *key, unsigned char *bu
|
||||||
bits = psa_get_key_bits(&attributes);
|
bits = psa_get_key_bits(&attributes);
|
||||||
psa_reset_key_attributes(&attributes);
|
psa_reset_key_attributes(&attributes);
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_ECP_LIGHT)
|
||||||
if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type)) {
|
if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(key_type)) {
|
||||||
curve = PSA_KEY_TYPE_ECC_GET_FAMILY(key_type);
|
curve = PSA_KEY_TYPE_ECC_GET_FAMILY(key_type);
|
||||||
if (curve == 0) {
|
if (curve == 0) {
|
||||||
|
@ -277,7 +280,9 @@ int mbedtls_pk_write_pubkey_der(const mbedtls_pk_context *key, unsigned char *bu
|
||||||
|
|
||||||
/* The rest of the function works as for legacy EC contexts. */
|
/* The rest of the function works as for legacy EC contexts. */
|
||||||
pk_type = MBEDTLS_PK_ECKEY;
|
pk_type = MBEDTLS_PK_ECKEY;
|
||||||
} else if (PSA_KEY_TYPE_IS_RSA(key_type)) {
|
} else
|
||||||
|
#endif /* MBEDTLS_ECP_LIGHT */
|
||||||
|
if (PSA_KEY_TYPE_IS_RSA(key_type)) {
|
||||||
/* The rest of the function works as for legacy RSA contexts. */
|
/* The rest of the function works as for legacy RSA contexts. */
|
||||||
pk_type = MBEDTLS_PK_RSA;
|
pk_type = MBEDTLS_PK_RSA;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue