Skip to content

Commit

Permalink
feat(core): improve optiga initialization error handling
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
onvej-sl committed Jul 31, 2024
1 parent 9746308 commit 52437b1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/embed/firmware/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,17 @@ int main(void) {
#endif

optiga_init();
optiga_open_application();
if (sectrue == secret_ok) {
optiga_sec_chan_handshake(secret, sizeof(secret));
// If the shielded connection cannot be established, reset Optiga and
// continue without it. In this case, OID_KEY_FIDO and OID_KEY_DEV cannot be
// used, which means device and FIDO attestation will not work.
if (optiga_sec_chan_handshake(secret, sizeof(secret)) != OPTIGA_SUCCESS) {
optiga_soft_reset();
}
}
memzero(secret, sizeof(secret));
ensure(sectrue * (optiga_open_application() == OPTIGA_SUCCESS),
"Cannot initialize optiga.");
#endif

#if !defined TREZOR_MODEL_1
Expand Down

0 comments on commit 52437b1

Please sign in to comment.