mirror of
https://github.com/polhenarejos/pico-fido.git
synced 2024-09-20 03:10:10 +00:00
Added fix for emulation conditional build.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
3d1c68fa40
commit
bd9d4286d5
@ -1 +1 @@
|
|||||||
Subproject commit 630da663c4bef29d938f238d77016a9c84ddae6d
|
Subproject commit 3947b59881d42ef75257908001f538e3becdd596
|
@ -22,6 +22,7 @@
|
|||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "asn1.h"
|
#include "asn1.h"
|
||||||
|
#include "hid/ctap_hid.h"
|
||||||
|
|
||||||
#define FIXED_SIZE 16
|
#define FIXED_SIZE 16
|
||||||
#define KEY_SIZE 16
|
#define KEY_SIZE 16
|
||||||
@ -130,6 +131,7 @@ extern int calculate_oath(uint8_t truncate,
|
|||||||
const uint8_t *chal,
|
const uint8_t *chal,
|
||||||
size_t chal_len);
|
size_t chal_len);
|
||||||
int otp_button_pressed(uint8_t slot) {
|
int otp_button_pressed(uint8_t slot) {
|
||||||
|
#ifndef ENABLE_EMULATION
|
||||||
printf("CB PRESSED slot %d\n", slot);
|
printf("CB PRESSED slot %d\n", slot);
|
||||||
file_t *ef = search_dynamic_file(slot == 1 ? EF_OTP_SLOT1 : EF_OTP_SLOT2);
|
file_t *ef = search_dynamic_file(slot == 1 ? EF_OTP_SLOT1 : EF_OTP_SLOT2);
|
||||||
const uint8_t *data = file_get_data(ef);
|
const uint8_t *data = file_get_data(ef);
|
||||||
@ -161,11 +163,11 @@ int otp_button_pressed(uint8_t slot) {
|
|||||||
number %= base;
|
number %= base;
|
||||||
char number_str[9];
|
char number_str[9];
|
||||||
if (otp_config->cfg_flags & OATH_HOTP8) {
|
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);
|
add_keyboard_buffer((const uint8_t *)number_str, 8, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(number_str, "%06lu", number);
|
sprintf(number_str, "%06lu", (long unsigned int)number);
|
||||||
add_keyboard_buffer((const uint8_t *)number_str, 6, true);
|
add_keyboard_buffer((const uint8_t *)number_str, 6, true);
|
||||||
}
|
}
|
||||||
imf++;
|
imf++;
|
||||||
@ -192,6 +194,7 @@ int otp_button_pressed(uint8_t slot) {
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user