Skip to content

Commit db23520

Browse files
SebastianBoerlubos
authored andcommitted
nrf_security: Drop support for embedded keys
Embedded keys were introduced to support a SUIT use-case. But there will not be any more releases of SUIT based on NCS master so we do not need this support any more. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent 0f295a7 commit db23520

File tree

3 files changed

+1
-92
lines changed

3 files changed

+1
-92
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/cracenpsa.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,4 @@ if(CONFIG_PSA_NEED_CRACEN_PLATFORM_KEYS)
131131
list(APPEND cracen_driver_sources
132132
${CMAKE_CURRENT_LIST_DIR}/src/platform_keys/platform_keys.c
133133
)
134-
zephyr_linker_sources(ROM_START SORT_KEY 0x1keys ${CMAKE_CURRENT_LIST_DIR}/src/platform_keys/platform_keys.ld)
135134
endif()

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys/platform_keys.c

Lines changed: 1 addition & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -71,59 +71,6 @@ typedef struct sicr_key {
7171
size_t mac_size;
7272
} sicr_key;
7373

74-
typedef struct embedded_key {
75-
uint32_t id;
76-
uint8_t key_buffer[32];
77-
size_t key_buffer_size;
78-
psa_key_type_t type;
79-
psa_key_bits_t bits;
80-
} embedded_key;
81-
82-
const embedded_key embedded_keys[] __attribute__((section("_embedded_keys"))) = {
83-
{0x4000BB00,
84-
{
85-
#include <public_key_native_MANIFEST_PUBKEY_NRF_TOP_0.bin.inc>
86-
},
87-
32,
88-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS),
89-
255},
90-
{0x4000BB01,
91-
{
92-
#include <public_key_native_MANIFEST_PUBKEY_NRF_TOP_1.bin.inc>
93-
},
94-
32,
95-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS),
96-
255},
97-
{0x4000BB02,
98-
{
99-
#include <public_key_native_MANIFEST_PUBKEY_NRF_TOP_2.bin.inc>
100-
},
101-
32,
102-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS),
103-
255},
104-
{0x40082100,
105-
{
106-
#include <public_key_native_MANIFEST_PUBKEY_SYSCTRL_0.bin.inc>
107-
},
108-
32,
109-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS),
110-
255},
111-
{0x40082101,
112-
{
113-
#include <public_key_native_MANIFEST_PUBKEY_SYSCTRL_1.bin.inc>
114-
},
115-
32,
116-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS),
117-
255},
118-
{0x40082102,
119-
{
120-
#include <public_key_native_MANIFEST_PUBKEY_SYSCTRL_2.bin.inc>
121-
},
122-
32,
123-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS),
124-
255},
125-
};
126-
12774
typedef struct derived_key {
12875
char label[DERIVED_KEY_MAX_LABEL_SIZE];
12976
} derived_key;
@@ -135,14 +82,12 @@ typedef struct ikg_key {
13582

13683
typedef union {
13784
sicr_key sicr;
138-
embedded_key embedded;
13985
derived_key derived;
14086
ikg_key ikg;
14187
} platform_key;
14288

14389
typedef enum {
14490
INVALID,
145-
EMBEDDED,
14691
DERIVED,
14792
SICR,
14893
IKG,
@@ -279,13 +224,6 @@ static key_type find_key(uint32_t id, platform_key *key)
279224
return IKG;
280225
}
281226

282-
for (size_t i = 0; i < ARRAY_SIZE(embedded_keys); i++) {
283-
if (id == embedded_keys[i].id) {
284-
key->embedded = embedded_keys[i];
285-
return EMBEDDED;
286-
}
287-
}
288-
289227
return INVALID;
290228
}
291229

@@ -487,33 +425,6 @@ psa_status_t cracen_platform_get_builtin_key(psa_drv_slot_number_t slot_number,
487425
return status;
488426
}
489427

490-
if (type == EMBEDDED) {
491-
psa_set_key_bits(attributes, key.embedded.bits);
492-
psa_set_key_type(attributes, key.embedded.type);
493-
494-
if (key.embedded.type ==
495-
PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_TWISTED_EDWARDS)) {
496-
psa_set_key_algorithm(attributes, PSA_ALG_PURE_EDDSA);
497-
psa_set_key_usage_flags(attributes, PSA_KEY_USAGE_VERIFY_MESSAGE);
498-
} else {
499-
return PSA_ERROR_INVALID_HANDLE;
500-
}
501-
502-
/* Note: PSA Driver wrapper API require that attributes are filled before returning
503-
* error.
504-
*/
505-
if (key.embedded.key_buffer_size > key_buffer_size) {
506-
return PSA_ERROR_BUFFER_TOO_SMALL;
507-
} else if (key_buffer == NULL || key_buffer_length == NULL) {
508-
return PSA_ERROR_INVALID_ARGUMENT;
509-
}
510-
511-
memcpy(key_buffer, key.embedded.key_buffer, key.embedded.key_buffer_size);
512-
*key_buffer_length = key.embedded.key_buffer_size;
513-
514-
return PSA_SUCCESS;
515-
}
516-
517428
if (type == DERIVED) {
518429
psa_set_key_bits(attributes, 256);
519430
psa_set_key_type(attributes, PSA_KEY_TYPE_AES);
@@ -604,7 +515,7 @@ psa_status_t cracen_platform_get_key_slot(mbedtls_svc_key_id_t key_id, psa_key_l
604515
return status;
605516
}
606517

607-
if (type == SICR || type == EMBEDDED || type == DERIVED) {
518+
if (type == SICR || type == DERIVED) {
608519
*slot_number = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key_id);
609520
*lifetime = PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
610521
PSA_KEY_PERSISTENCE_READ_ONLY, PSA_KEY_LOCATION_CRACEN);

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys/platform_keys.ld

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)