1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-25 03:29:02 +00:00

fix(core/prodtest): fix prodtest run with unlocked bootloader

[no changelog]
This commit is contained in:
tychovrahe 2024-09-05 16:18:46 +02:00 committed by TychoVrahe
parent be9255ae04
commit 5eb68975d9

View File

@ -143,6 +143,12 @@ void pair_optiga(void) {
uint8_t secret[SECRET_OPTIGA_KEY_LEN] = {0};
if (secret_optiga_get(secret) != sectrue) {
if (secret_optiga_writable() != sectrue) {
// optiga pairing secret is unwritable, so fail
optiga_pairing_state = OPTIGA_PAIRING_ERR_WRITE_FLASH;
return;
}
// Generate the pairing secret.
if (OPTIGA_SUCCESS != optiga_get_random(secret, sizeof(secret))) {
optiga_pairing_state = OPTIGA_PAIRING_ERR_RNG;