Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable os_perso_is_pin_set for non-privileged applications #391

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/os_pin.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SYSCALL PERMISSION(APPLICATION_FLAG_GLOBAL_PIN) unsigned int os_global_pin_retri
* @return BOLOS_TRUE if the CRC of N_secure_element_nvram_user_sensitive_data
* is correct and if a PIN value has been written
*/
SYSCALL PERMISSION(APPLICATION_FLAG_BOLOS_UX)
SYSCALL
bolos_bool_t os_perso_is_pin_set(void);


Expand Down
7 changes: 1 addition & 6 deletions src/os_io_seproxyhal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,13 +1414,8 @@ 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
// for Bolos UX and apps, 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