From eae22a97fbc38b02aea6fc4a59312b9dc85ccba4 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 23 Sep 2025 17:17:01 +0200 Subject: [PATCH] Fix conditional build. Signed-off-by: Pol Henarejos --- src/fido/fido.c | 4 +++- src/fido/management.c | 2 ++ src/fido/otp.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fido/fido.c b/src/fido/fido.c index b14d6ab..b9a0ef8 100644 --- a/src/fido/fido.c +++ b/src/fido/fido.c @@ -459,12 +459,14 @@ void scan_all() { extern void init_otp(); void init_fido() { scan_all(); +#ifdef ENABLE_OTP_APP init_otp(); +#endif } bool wait_button_pressed() { uint32_t val = EV_PRESS_BUTTON; -#ifndef ENABLE_EMULATION +#if defined(PICO_PLATFORM) || defined(ESP_PLATFORM) queue_try_add(&card_to_usb_q, &val); do { queue_remove_blocking(&usb_to_card_q, &val); diff --git a/src/fido/management.c b/src/fido/management.c index 6f6360d..95b08f9 100644 --- a/src/fido/management.c +++ b/src/fido/management.c @@ -40,7 +40,9 @@ int man_select(app_t *a, uint8_t force) { apdu.ne = res_APDU_size; if (force) { scan_all(); +#ifdef ENABLE_OTP_APP init_otp(); +#endif } return PICOKEY_OK; } diff --git a/src/fido/otp.c b/src/fido/otp.c index a9adf33..f893b30 100644 --- a/src/fido/otp.c +++ b/src/fido/otp.c @@ -216,6 +216,7 @@ int otp_button_pressed(uint8_t slot) { if (otp_config->cfg_flags & CHAL_YUBICO && otp_config->tkt_flags & CHAL_RESP) { return 2; } +#ifdef ENABLE_OATH_APP if (otp_config->tkt_flags & OATH_HOTP) { uint8_t tmp_key[KEY_SIZE + 2]; tmp_key[0] = 0x01; @@ -257,6 +258,7 @@ int otp_button_pressed(uint8_t slot) { append_keyboard_buffer((const uint8_t *) "\r", 1); } } +#endif else if (otp_config->cfg_flags & SHORT_TICKET || otp_config->cfg_flags & STATIC_TICKET) { uint8_t fixed_size = FIXED_SIZE + UID_SIZE + KEY_SIZE; if (otp_config->cfg_flags & SHORT_TICKET) { // Not clear which is the purpose of SHORT_TICKET