commit
5f3974a4e6
15
fido2/ctap.c
15
fido2/ctap.c
@ -466,12 +466,11 @@ static int ctap_make_auth_data(struct rpId * rp, CborEncoder * map, uint8_t * au
|
|||||||
count = auth_data_update_count(&authData->head);
|
count = auth_data_update_count(&authData->head);
|
||||||
|
|
||||||
device_set_status(CTAPHID_STATUS_UPNEEDED);
|
device_set_status(CTAPHID_STATUS_UPNEEDED);
|
||||||
// if NFC - not need to click a button
|
|
||||||
int but = 1;
|
int but;
|
||||||
if(!device_is_nfc())
|
|
||||||
{
|
but = ctap_user_presence_test();
|
||||||
but = ctap_user_presence_test();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!but)
|
if (!but)
|
||||||
{
|
{
|
||||||
@ -704,7 +703,7 @@ uint8_t ctap_make_credential(CborEncoder * encoder, uint8_t * request, int lengt
|
|||||||
}
|
}
|
||||||
if (MC.pinAuthEmpty)
|
if (MC.pinAuthEmpty)
|
||||||
{
|
{
|
||||||
if (!device_is_nfc() && !ctap_user_presence_test())
|
if (!ctap_user_presence_test())
|
||||||
{
|
{
|
||||||
return CTAP2_ERR_OPERATION_DENIED;
|
return CTAP2_ERR_OPERATION_DENIED;
|
||||||
}
|
}
|
||||||
@ -1143,7 +1142,7 @@ uint8_t ctap_get_assertion(CborEncoder * encoder, uint8_t * request, int length)
|
|||||||
|
|
||||||
if (GA.pinAuthEmpty)
|
if (GA.pinAuthEmpty)
|
||||||
{
|
{
|
||||||
if (!device_is_nfc() && !ctap_user_presence_test())
|
if (!ctap_user_presence_test())
|
||||||
{
|
{
|
||||||
return CTAP2_ERR_OPERATION_DENIED;
|
return CTAP2_ERR_OPERATION_DENIED;
|
||||||
}
|
}
|
||||||
|
@ -81,4 +81,4 @@ cbor:
|
|||||||
cd ../../tinycbor/ && make clean
|
cd ../../tinycbor/ && make clean
|
||||||
cd ../../tinycbor/ && make CC="$(CC)" AR=$(AR) \
|
cd ../../tinycbor/ && make CC="$(CC)" AR=$(AR) \
|
||||||
LDFLAGS="$(LDFLAGS_LIB)" \
|
LDFLAGS="$(LDFLAGS_LIB)" \
|
||||||
CFLAGS="$(CFLAGS)"
|
CFLAGS="$(CFLAGS) -Os"
|
||||||
|
@ -111,13 +111,13 @@ void device_init()
|
|||||||
{
|
{
|
||||||
|
|
||||||
hw_init(LOW_FREQUENCY);
|
hw_init(LOW_FREQUENCY);
|
||||||
isLowFreq = 0;
|
|
||||||
|
|
||||||
haveNFC = nfc_init();
|
haveNFC = nfc_init();
|
||||||
|
|
||||||
if (haveNFC)
|
if (haveNFC)
|
||||||
{
|
{
|
||||||
printf1(TAG_NFC, "Have NFC\r\n");
|
printf1(TAG_NFC, "Have NFC\r\n");
|
||||||
|
isLowFreq = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -460,6 +460,10 @@ static int handle_packets()
|
|||||||
int ctap_user_presence_test()
|
int ctap_user_presence_test()
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
if (device_is_nfc())
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
#if SKIP_BUTTON_CHECK_WITH_DELAY
|
#if SKIP_BUTTON_CHECK_WITH_DELAY
|
||||||
int i=500;
|
int i=500;
|
||||||
while(i--)
|
while(i--)
|
||||||
|
@ -496,9 +496,9 @@ void nfc_process_iblock(uint8_t * buf, int len)
|
|||||||
// WTX_on(WTX_TIME_DEFAULT);
|
// WTX_on(WTX_TIME_DEFAULT);
|
||||||
// SystemClock_Config_LF32();
|
// SystemClock_Config_LF32();
|
||||||
// delay(300);
|
// delay(300);
|
||||||
device_set_clock_rate(DEVICE_LOW_POWER_FAST);;
|
if (device_is_nfc()) device_set_clock_rate(DEVICE_LOW_POWER_FAST);;
|
||||||
u2f_request_nfc(&buf[1], len, &ctap_resp);
|
u2f_request_nfc(&buf[1], len, &ctap_resp);
|
||||||
device_set_clock_rate(DEVICE_LOW_POWER_IDLE);;
|
if (device_is_nfc()) device_set_clock_rate(DEVICE_LOW_POWER_IDLE);;
|
||||||
// if (!WTX_off())
|
// if (!WTX_off())
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user