wrong size, causes RK's to be overwritten

This commit is contained in:
Conor Patrick 2019-03-02 00:55:25 -05:00
parent e31e703afd
commit 35707c3797

View File

@ -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)); memmove(tmppage + (sizeof(CTAP_residentKey) * index) % PAGE_SIZE, rk, sizeof(CTAP_residentKey));
flash_erase_page(page); 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 else
{ {