mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-28 08:11:02 +00:00
firmware: fix last commit - lock randomness block after set
This commit is contained in:
parent
ee3e313230
commit
6233cc0720
@ -352,7 +352,7 @@ static void test_otp_write(const char *args)
|
||||
memzero(data, sizeof(data));
|
||||
strncpy(data, args, sizeof(data) - 1);
|
||||
ensure(flash_otp_write(FLASH_OTP_BLOCK_BATCH, 0, (const uint8_t *) data, sizeof(data)), NULL);
|
||||
ensure(flash_otp_lock(0), NULL);
|
||||
ensure(flash_otp_lock(FLASH_OTP_BLOCK_BATCH), NULL);
|
||||
vcp_printf("OK");
|
||||
}
|
||||
|
||||
|
@ -151,6 +151,7 @@ void collect_hw_entropy(void)
|
||||
uint8_t entropy[FLASH_OTP_BLOCK_SIZE];
|
||||
random_buffer(entropy, FLASH_OTP_BLOCK_SIZE);
|
||||
ensure(flash_otp_write(FLASH_OTP_BLOCK_RANDOMNESS, 0, entropy, FLASH_OTP_BLOCK_SIZE), NULL);
|
||||
ensure(flash_otp_lock(FLASH_OTP_BLOCK_RANDOMNESS), NULL);
|
||||
}
|
||||
// collect entropy from OTP randomness block
|
||||
ensure(flash_otp_read(FLASH_OTP_BLOCK_RANDOMNESS, 0, HW_ENTROPY_DATA + 12, FLASH_OTP_BLOCK_SIZE), NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user