mirror of
https://github.com/polhenarejos/pico-fido.git
synced 2024-09-20 03:10:10 +00:00
Fix enabled capabilities detection.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
2b1227b105
commit
aa7362f88f
@ -63,7 +63,7 @@ bool cap_supported(uint16_t cap) {
|
||||
if (tag == TAG_USB_ENABLED) {
|
||||
uint16_t ecaps = tag_data[0];
|
||||
if (tag_len == 2) {
|
||||
ecaps = (tag_data[1] << 8) | tag_data[0];
|
||||
ecaps = (tag_data[0] << 8) | tag_data[1];
|
||||
}
|
||||
return (ecaps & cap);
|
||||
}
|
||||
|
@ -176,10 +176,10 @@ extern int calculate_oath(uint8_t truncate,
|
||||
static uint8_t session_counter[2] = {0};
|
||||
#endif
|
||||
int otp_button_pressed(uint8_t slot) {
|
||||
init_otp();
|
||||
if (!cap_supported(CAP_OTP)) {
|
||||
return 3;
|
||||
}
|
||||
init_otp();
|
||||
#ifndef ENABLE_EMULATION
|
||||
file_t *ef = search_dynamic_file(slot == 1 ? EF_OTP_SLOT1 : EF_OTP_SLOT2);
|
||||
const uint8_t *data = file_get_data(ef);
|
||||
|
Loading…
Reference in New Issue
Block a user