Skip to content

Commit dcec607

Browse files
michalek-nonordicjm
authored andcommitted
Revert "[nrf noup] bootutil: key revocation"
This reverts commit 6227d66.
1 parent 2534681 commit dcec607

File tree

6 files changed

+0
-129
lines changed

6 files changed

+0
-129
lines changed

boot/bootutil/include/bootutil/key_revocation.h

Lines changed: 0 additions & 30 deletions
This file was deleted.

boot/bootutil/src/ed25519_psa.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ static psa_key_id_t kmu_key_ids[3] = {
3232
MAKE_PSA_KMU_KEY_ID(230)
3333
};
3434

35-
#if defined(CONFIG_BOOT_KMU_KEYS_REVOCATION)
36-
#include <bootutil/key_revocation.h>
37-
static psa_key_id_t *validated_with = NULL;
38-
#endif
39-
4035
BUILD_ASSERT(CONFIG_BOOT_SIGNATURE_KMU_SLOTS <= ARRAY_SIZE(kmu_key_ids),
4136
"Invalid number of KMU slots, up to 3 are supported on nRF54L15");
4237
#endif
@@ -121,9 +116,6 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
121116
EDDSA_SIGNAGURE_LENGTH);
122117
if (status == PSA_SUCCESS) {
123118
ret = 1;
124-
#if defined(CONFIG_BOOT_KMU_KEYS_REVOCATION)
125-
validated_with = kmu_key_ids + i;
126-
#endif
127119
break;
128120
}
129121

@@ -132,37 +124,4 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
132124

133125
return ret;
134126
}
135-
#if defined(CONFIG_BOOT_KMU_KEYS_REVOCATION)
136-
int exec_revoke(void)
137-
{
138-
int ret = BOOT_KEY_REVOKE_OK;
139-
psa_status_t status = psa_crypto_init();
140-
141-
if (!validated_with) {
142-
ret = BOOT_KEY_REVOKE_INVALID;
143-
goto out;
144-
}
145-
146-
if (status != PSA_SUCCESS) {
147-
BOOT_LOG_ERR("PSA crypto init failed with error %d", status);
148-
ret = BOOT_KEY_REVOKE_FAILED;
149-
goto out;
150-
}
151-
for (int i = 0; i < CONFIG_BOOT_SIGNATURE_KMU_SLOTS; i++) {
152-
if ((kmu_key_ids + i) == validated_with) {
153-
break;
154-
}
155-
BOOT_LOG_DBG("Invalidating key ID %d", i);
156-
157-
status = psa_destroy_key(kmu_key_ids[i]);
158-
if (status == PSA_SUCCESS) {
159-
BOOT_LOG_DBG("Success on key ID %d", i);
160-
} else {
161-
BOOT_LOG_ERR("Key invalidation failed with: %d", status);
162-
}
163-
}
164-
out:
165-
return ret;
166-
}
167-
#endif /* CONFIG_BOOT_KMU_KEYS_REVOCATION */
168127
#endif

boot/bootutil/src/key_revocation.c

Lines changed: 0 additions & 24 deletions
This file was deleted.

boot/bootutil/src/loader.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ int pcd_version_cmp_net(const struct flash_area *fap, struct image_header *hdr);
8080

8181
#include "mcuboot_config/mcuboot_config.h"
8282

83-
#if defined(CONFIG_BOOT_KEYS_REVOCATION)
84-
#include "bootutil/key_revocation.h"
85-
#endif
86-
8783
BOOT_LOG_MODULE_DECLARE(mcuboot);
8884

8985
static struct boot_loader_state boot_data;
@@ -3063,11 +3059,6 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
30633059
}
30643060
}
30653061

3066-
#if defined(CONFIG_BOOT_KEYS_REVOCATION)
3067-
if (BOOT_SWAP_TYPE(state) == BOOT_SWAP_TYPE_NONE) {
3068-
allow_revoke();
3069-
}
3070-
#endif
30713062
/* Iterate over all the images. At this point all required update operations
30723063
* have finished. By the end of the loop each image in the primary slot will
30733064
* have been re-validated.
@@ -3176,13 +3167,6 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
31763167
fill_rsp(state, rsp);
31773168

31783169
fih_rc = FIH_SUCCESS;
3179-
#if defined(CONFIG_BOOT_KEYS_REVOCATION)
3180-
rc = revoke();
3181-
if (rc != BOOT_KEY_REVOKE_OK &&
3182-
rc != BOOT_KEY_REVOKE_NOT_READY) {
3183-
FIH_SET(fih_rc, FIH_FAILURE);
3184-
}
3185-
#endif /* CONFIG_BOOT_KEYS_REVOCATION */
31863170
out:
31873171
/*
31883172
* Since the boot_status struct stores plaintext encryption keys, reset

boot/zephyr/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ if(DEFINED CONFIG_BOOT_SHARE_BACKEND_RETENTION)
104104
)
105105
endif()
106106

107-
if(DEFINED CONFIG_BOOT_KEYS_REVOCATION)
108-
zephyr_library_sources(
109-
${BOOT_DIR}/bootutil/src/key_revocation.c
110-
)
111-
endif()
112-
113107
# Generic bootutil sources and includes.
114108
zephyr_library_include_directories(${BOOT_DIR}/bootutil/include)
115109
zephyr_library_sources(

boot/zephyr/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -358,18 +358,6 @@ config BOOT_SIGNATURE_KMU_SLOTS
358358

359359
endif
360360

361-
config BOOT_KEYS_REVOCATION
362-
bool "Auto revoke previous gen key"
363-
help
364-
Automatically revoke previous generation key upon new valid key usage.
365-
366-
config BOOT_KMU_KEYS_REVOCATION
367-
bool
368-
depends on BOOT_KEYS_REVOCATION
369-
default y if BOOT_SIGNATURE_USING_KMU
370-
help
371-
Enabling KMU key revocation backend.
372-
373361
if !BOOT_SIGNATURE_USING_KMU
374362

375363
config BOOT_SIGNATURE_KEY_FILE

0 commit comments

Comments
 (0)