Skip to content

Commit

Permalink
feat(core): Don't lock Optiga in debug builds.
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
andrewkozlik committed May 3, 2024
1 parent 54c441a commit ed43a5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/embed/trezorhal/optiga/optiga.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ bool optiga_set_metadata(uint16_t oid, const optiga_metadata *metadata) {
}
}

// If the metadata aren't locked, then lock them.
#if PRODUCTION
// If the metadata aren't locked, then lock them in production builds.
optiga_metadata metadata_locked = {0};
metadata_locked.lcso = OPTIGA_META_LCS_OPERATIONAL;
if (!optiga_compare_metadata(&metadata_locked, &metadata_stored)) {
Expand All @@ -231,6 +232,7 @@ bool optiga_set_metadata(uint16_t oid, const optiga_metadata *metadata) {
return false;
}
}
#endif

return true;
}
Expand Down

0 comments on commit ed43a5b

Please sign in to comment.