fix user presence skipping for nfc

This commit is contained in:
Conor Patrick 2019-05-09 17:26:28 -04:00
parent 54792b345c
commit e402d36bf1
3 changed files with 8 additions and 8 deletions

View File

@ -19,6 +19,7 @@
#include "crypto.h"
#include "util.h"
#include "log.h"
#include "nfc.h"
#include "device.h"
#include APP_CONFIG
#include "wallet.h"
@ -1759,7 +1760,7 @@ void ctap_init()
exit(1);
}
if (! device_is_nfc())
if (device_is_nfc() != NFC_IS_ACTIVE)
{
ctap_reset_key_agreement();
}

View File

@ -238,7 +238,7 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c
if (control == U2F_AUTHENTICATE_SIGN_NO_USER)
up = 0;
if(!device_is_nfc() && up)
if(up)
{
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;
if(!device_is_nfc())
{
if ( ! ctap_user_presence_test())
{
return U2F_SW_CONDITIONS_NOT_SATISFIED;
}
}
if ( u2f_new_keypair(&key_handle, req->app, pubkey) == -1)
{

View File

@ -491,7 +491,7 @@ static int handle_packets()
int ctap_user_presence_test()
{
int ret;
if (device_is_nfc())
if (device_is_nfc() == NFC_IS_ACTIVE)
{
return 1;
}