Skip to content

Commit

Permalink
fix(core/prodtest): fix prodtest run with unlocked bootloader
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
TychoVrahe committed Sep 7, 2024
1 parent be9255a commit 5eb6897
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/embed/prodtest/optiga_prodtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5eb6897

Please sign in to comment.