Skip to content

Commit e8fe74a

Browse files
author
Oliver Mueller
committed
give the hash of the received key to boot_retrieve_public_key_hash
This enables a key revoking/invalidation scheme as mentioned in #221 Signed-off-by: Oliver Mueller <olstyle@gmx.de>
1 parent 05d1194 commit e8fe74a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

boot/bootutil/include/bootutil/sign_key.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ extern struct bootutil_key bootutil_keys[];
5151
* Retrieve the hash of the corresponding public key for image authentication.
5252
*
5353
* @param[in] image_index Index of the image to be authenticated.
54+
* @param[in] actual_key_hash hash of the key to test
5455
* @param[out] public_key_hash Buffer to store the key-hash in.
5556
* @param[in,out] key_hash_size As input the size of the buffer. As output
5657
* the actual key-hash length.
5758
*
5859
* @return 0 on success; nonzero on failure.
5960
*/
6061
int boot_retrieve_public_key_hash(uint8_t image_index,
62+
const uint8_t *actual_key_hash,
6163
uint8_t *public_key_hash,
6264
size_t *key_hash_size);
6365
#endif /* !MCUBOOT_HW_KEY */

boot/bootutil/src/image_validate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ bootutil_find_key(uint8_t image_index, uint8_t *key, uint16_t key_len)
245245
bootutil_sha_finish(&sha_ctx, hash);
246246
bootutil_sha_drop(&sha_ctx);
247247

248-
rc = boot_retrieve_public_key_hash(image_index, key_hash, &key_hash_size);
248+
rc = boot_retrieve_public_key_hash(image_index, hash, key_hash, &key_hash_size);
249249
if (rc) {
250250
return -1;
251251
}

0 commit comments

Comments
 (0)