make sure device status is set in all user presence tests
This commit is contained in:
parent
b47854c335
commit
78e3b291c2
18
fido2/ctap.c
18
fido2/ctap.c
@ -432,6 +432,12 @@ static unsigned int get_credential_id_size(CTAP_credentialDescriptor * cred)
|
|||||||
return sizeof(CredentialId);
|
return sizeof(CredentialId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ctap2_user_presence_test()
|
||||||
|
{
|
||||||
|
device_set_status(CTAPHID_STATUS_UPNEEDED);
|
||||||
|
return ctap_user_presence_test(CTAP2_UP_DELAY_MS);
|
||||||
|
}
|
||||||
|
|
||||||
static int ctap_make_auth_data(struct rpId * rp, CborEncoder * map, uint8_t * auth_data_buf, uint32_t * len, CTAP_credInfo * credInfo)
|
static int ctap_make_auth_data(struct rpId * rp, CborEncoder * map, uint8_t * auth_data_buf, uint32_t * len, CTAP_credInfo * credInfo)
|
||||||
{
|
{
|
||||||
CborEncoder cose_key;
|
CborEncoder cose_key;
|
||||||
@ -459,11 +465,9 @@ 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);
|
|
||||||
|
|
||||||
int but;
|
int but;
|
||||||
|
|
||||||
but = ctap_user_presence_test(CTAP2_UP_DELAY_MS);
|
but = ctap2_user_presence_test(CTAP2_UP_DELAY_MS);
|
||||||
|
|
||||||
if (!but)
|
if (!but)
|
||||||
{
|
{
|
||||||
@ -473,7 +477,7 @@ static int ctap_make_auth_data(struct rpId * rp, CborEncoder * map, uint8_t * au
|
|||||||
{
|
{
|
||||||
return CTAP2_ERR_KEEPALIVE_CANCEL;
|
return CTAP2_ERR_KEEPALIVE_CANCEL;
|
||||||
}
|
}
|
||||||
device_set_status(CTAPHID_STATUS_PROCESSING);
|
// device_set_status(CTAPHID_STATUS_PROCESSING);
|
||||||
|
|
||||||
authData->head.flags = (but << 0);
|
authData->head.flags = (but << 0);
|
||||||
authData->head.flags |= (ctap_is_pin_set() << 2);
|
authData->head.flags |= (ctap_is_pin_set() << 2);
|
||||||
@ -700,7 +704,7 @@ uint8_t ctap_make_credential(CborEncoder * encoder, uint8_t * request, int lengt
|
|||||||
}
|
}
|
||||||
if (MC.pinAuthEmpty)
|
if (MC.pinAuthEmpty)
|
||||||
{
|
{
|
||||||
if (!ctap_user_presence_test(CTAP2_UP_DELAY_MS))
|
if (!ctap2_user_presence_test(CTAP2_UP_DELAY_MS))
|
||||||
{
|
{
|
||||||
return CTAP2_ERR_OPERATION_DENIED;
|
return CTAP2_ERR_OPERATION_DENIED;
|
||||||
}
|
}
|
||||||
@ -1136,7 +1140,7 @@ uint8_t ctap_get_assertion(CborEncoder * encoder, uint8_t * request, int length)
|
|||||||
|
|
||||||
if (GA.pinAuthEmpty)
|
if (GA.pinAuthEmpty)
|
||||||
{
|
{
|
||||||
if (!ctap_user_presence_test(CTAP2_UP_DELAY_MS))
|
if (!ctap2_user_presence_test(CTAP2_UP_DELAY_MS))
|
||||||
{
|
{
|
||||||
return CTAP2_ERR_OPERATION_DENIED;
|
return CTAP2_ERR_OPERATION_DENIED;
|
||||||
}
|
}
|
||||||
@ -1646,7 +1650,7 @@ uint8_t ctap_request(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp)
|
|||||||
break;
|
break;
|
||||||
case CTAP_RESET:
|
case CTAP_RESET:
|
||||||
printf1(TAG_CTAP,"CTAP_RESET\n");
|
printf1(TAG_CTAP,"CTAP_RESET\n");
|
||||||
if (ctap_user_presence_test(CTAP2_UP_DELAY_MS))
|
if (ctap2_user_presence_test(CTAP2_UP_DELAY_MS))
|
||||||
{
|
{
|
||||||
ctap_reset();
|
ctap_reset();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user