From 35707c37978aad7a5122b131ca8c0e48d87b5089 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sat, 2 Mar 2019 00:55:25 -0500 Subject: [PATCH] wrong size, causes RK's to be overwritten --- targets/stm32l432/src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/stm32l432/src/device.c b/targets/stm32l432/src/device.c index d65b7f8..da82d8b 100644 --- a/targets/stm32l432/src/device.c +++ b/targets/stm32l432/src/device.c @@ -596,7 +596,7 @@ void ctap_overwrite_rk(int index,CTAP_residentKey * rk) memmove(tmppage + (sizeof(CTAP_residentKey) * index) % PAGE_SIZE, rk, sizeof(CTAP_residentKey)); flash_erase_page(page); - flash_write(flash_addr(page), tmppage, ((sizeof(CTAP_residentKey) * (index + 1)) % PAGE_SIZE) ); + flash_write(flash_addr(page), tmppage, PAGE_SIZE); } else {