diff --git a/pico-hsm-sdk b/pico-hsm-sdk index 630da66..3947b59 160000 --- a/pico-hsm-sdk +++ b/pico-hsm-sdk @@ -1 +1 @@ -Subproject commit 630da663c4bef29d938f238d77016a9c84ddae6d +Subproject commit 3947b59881d42ef75257908001f538e3becdd596 diff --git a/src/fido/otp.c b/src/fido/otp.c index 9e32c64..f194fd0 100644 --- a/src/fido/otp.c +++ b/src/fido/otp.c @@ -22,6 +22,7 @@ #include "random.h" #include "version.h" #include "asn1.h" +#include "hid/ctap_hid.h" #define FIXED_SIZE 16 #define KEY_SIZE 16 @@ -130,6 +131,7 @@ extern int calculate_oath(uint8_t truncate, const uint8_t *chal, size_t chal_len); int otp_button_pressed(uint8_t slot) { +#ifndef ENABLE_EMULATION printf("CB PRESSED slot %d\n", slot); file_t *ef = search_dynamic_file(slot == 1 ? EF_OTP_SLOT1 : EF_OTP_SLOT2); const uint8_t *data = file_get_data(ef); @@ -161,11 +163,11 @@ int otp_button_pressed(uint8_t slot) { number %= base; char number_str[9]; if (otp_config->cfg_flags & OATH_HOTP8) { - sprintf(number_str, "%08lu", number); + sprintf(number_str, "%08lu", (long unsigned int)number); add_keyboard_buffer((const uint8_t *)number_str, 8, true); } else { - sprintf(number_str, "%06lu", number); + sprintf(number_str, "%06lu", (long unsigned int)number); add_keyboard_buffer((const uint8_t *)number_str, 6, true); } imf++; @@ -192,6 +194,7 @@ int otp_button_pressed(uint8_t slot) { else { } +#endif return 0; }