From 17ceb7b9e87e6ce3dd61040ff59bf928a9404654 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Wed, 7 Aug 2019 14:32:53 +0200 Subject: [PATCH] Make the public key generic --- targets/stm32l432/bootloader/bootloader.c | 4 ++-- targets/stm32l432/bootloader/pubkey_bootloader.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/stm32l432/bootloader/bootloader.c b/targets/stm32l432/bootloader/bootloader.c index f41755d..dc9a407 100644 --- a/targets/stm32l432/bootloader/bootloader.c +++ b/targets/stm32l432/bootloader/bootloader.c @@ -167,7 +167,7 @@ int bootloader_bridge(int klen, uint8_t * keyh) return CTAP1_ERR_INVALID_LENGTH; } #ifndef SOLO_HACKER - extern uint8_t *pubkey_nitrokey_boot; + extern uint8_t *pubkey_boot; const struct uECC_Curve_t * curve = NULL; #endif @@ -226,7 +226,7 @@ int bootloader_bridge(int klen, uint8_t * keyh) curve = uECC_secp256r1(); // Verify incoming signature made over the SHA256 hash if ( - !uECC_verify(pubkey_nitrokey_boot, hash, 32, req->payload, curve) + !uECC_verify(pubkey_boot, hash, 32, req->payload, curve) ) { printf1(TAG_BOOT, "Signature invalid\r\n"); diff --git a/targets/stm32l432/bootloader/pubkey_bootloader.c b/targets/stm32l432/bootloader/pubkey_bootloader.c index 6b68745..f3ed754 100644 --- a/targets/stm32l432/bootloader/pubkey_bootloader.c +++ b/targets/stm32l432/bootloader/pubkey_bootloader.c @@ -1,3 +1,3 @@ #include "stdint.h" -uint8_t *pubkey_nitrokey_boot = (uint8_t *) "\x7b\x2a\x9c\xf8\x21\xf6\x91\x40\x9d\x6c\x42\xe1\xbb\xa1\x31\x82\x6c\x25\x39\x31\x5b\x59\x3c\x8e\x07\x8d\xfa\x0a\x3d\x21\x35\x6f\x58\x81\x4c\xf6\xd8\xf5\x6e\x6f\x62\xc8\x32\xd3\x13\x6f\xe1\xd6\x2d\x81\x52\xbf\x5f\x9e\xa9\x29\xc9\x9d\x9e\x2c\x89\x5f\x1b\x68"; +uint8_t *pubkey_boot = (uint8_t *) "\x7b\x2a\x9c\xf8\x21\xf6\x91\x40\x9d\x6c\x42\xe1\xbb\xa1\x31\x82\x6c\x25\x39\x31\x5b\x59\x3c\x8e\x07\x8d\xfa\x0a\x3d\x21\x35\x6f\x58\x81\x4c\xf6\xd8\xf5\x6e\x6f\x62\xc8\x32\xd3\x13\x6f\xe1\xd6\x2d\x81\x52\xbf\x5f\x9e\xa9\x29\xc9\x9d\x9e\x2c\x89\x5f\x1b\x68";