Skip to content

Commit

Permalink
Merge pull request #380 from LedgerHQ/ensure-no-os_perso_is_pin_set-i…
Browse files Browse the repository at this point in the history
…n-apps

Ensure no os perso is pin set in apps
  • Loading branch information
nroggeman-ledger authored Jul 20, 2023
2 parents 869eed5 + 6380b9b commit 5e4ea2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/os_io_seproxyhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,13 @@ unsigned short io_exchange(unsigned char channel, unsigned short tx_len) {

// An apdu has been received asynchronously.
if (G_io_app.apdu_state != APDU_IDLE && G_io_app.apdu_length > 0) {
#ifdef HAVE_BOLOS
// for Bolos UX, answer SWO_SEC_PIN_15 as soon as PIN has been set and PIN is not validated
if (os_perso_is_pin_set() == BOLOS_TRUE && os_global_pin_is_validated() != BOLOS_TRUE) {
#else // ! HAVE_BOLOS
// for Apps, answer SWO_SEC_PIN_15 as soon as device is onboarded and PIN is not validated
if (os_perso_isonboarded() == BOLOS_TRUE && os_global_pin_is_validated() != BOLOS_TRUE) {
#endif // ! HAVE_BOLOS
tx_len = 0;
G_io_apdu_buffer[(tx_len)++] = (SWO_SEC_PIN_15 >> 8) & 0xFF;
G_io_apdu_buffer[(tx_len)++] = (SWO_SEC_PIN_15) & 0xFF;
Expand Down

0 comments on commit 5e4ea2d

Please sign in to comment.