fix user presence skipping for nfc
This commit is contained in:
parent
54792b345c
commit
e402d36bf1
@ -19,6 +19,7 @@
|
|||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "nfc.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include APP_CONFIG
|
#include APP_CONFIG
|
||||||
#include "wallet.h"
|
#include "wallet.h"
|
||||||
@ -1759,7 +1760,7 @@ void ctap_init()
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! device_is_nfc())
|
if (device_is_nfc() != NFC_IS_ACTIVE)
|
||||||
{
|
{
|
||||||
ctap_reset_key_agreement();
|
ctap_reset_key_agreement();
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c
|
|||||||
if (control == U2F_AUTHENTICATE_SIGN_NO_USER)
|
if (control == U2F_AUTHENTICATE_SIGN_NO_USER)
|
||||||
up = 0;
|
up = 0;
|
||||||
|
|
||||||
if(!device_is_nfc() && up)
|
if(up)
|
||||||
{
|
{
|
||||||
if (ctap_user_presence_test() == 0)
|
if (ctap_user_presence_test() == 0)
|
||||||
{
|
{
|
||||||
@ -286,13 +286,12 @@ static int16_t u2f_register(struct u2f_register_request * req)
|
|||||||
|
|
||||||
const uint16_t attest_size = attestation_cert_der_size;
|
const uint16_t attest_size = attestation_cert_der_size;
|
||||||
|
|
||||||
if(!device_is_nfc())
|
|
||||||
{
|
|
||||||
if ( ! ctap_user_presence_test())
|
if ( ! ctap_user_presence_test())
|
||||||
{
|
{
|
||||||
return U2F_SW_CONDITIONS_NOT_SATISFIED;
|
return U2F_SW_CONDITIONS_NOT_SATISFIED;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( u2f_new_keypair(&key_handle, req->app, pubkey) == -1)
|
if ( u2f_new_keypair(&key_handle, req->app, pubkey) == -1)
|
||||||
{
|
{
|
||||||
|
@ -491,7 +491,7 @@ static int handle_packets()
|
|||||||
int ctap_user_presence_test()
|
int ctap_user_presence_test()
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
if (device_is_nfc())
|
if (device_is_nfc() == NFC_IS_ACTIVE)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user