firmware: fix last commit - lock randomness block after set

pull/25/head
Pavol Rusnak 5 years ago
parent ee3e313230
commit 6233cc0720
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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…
Cancel
Save