Skip to content
Permalink
Browse files

add UP wait HID messages to U2F for windows

  • Loading branch information...
conorpp committed May 9, 2019
1 parent e402d36 commit 9fb02d4da3a70e60ccaf59a83f0a15703942de7c
Showing with 7 additions and 6 deletions.
  1. +6 −5 fido2/u2f.c
  2. +1 −1 targets/stm32l432/src/device.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include "u2f.h"
#include "ctap.h"
#include "ctaphid.h"
#include "crypto.h"
#include "log.h"
#include "device.h"
@@ -95,6 +96,8 @@ void u2f_request_ex(APDU_HEADER *req, uint8_t *payload, uint32_t len, CTAP_RESPO
#endif
}

device_set_status(CTAPHID_STATUS_IDLE);

end:
if (rcode != U2F_SW_NO_ERROR)
{
@@ -240,12 +243,13 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c

if(up)
{
device_set_status(CTAPHID_STATUS_UPNEEDED);
if (ctap_user_presence_test() == 0)
{
return U2F_SW_CONDITIONS_NOT_SATISFIED;
}
}

count = ctap_atomic_count(0);
hash[0] = (count >> 24) & 0xff;
hash[1] = (count >> 16) & 0xff;
@@ -286,13 +290,12 @@ static int16_t u2f_register(struct u2f_register_request * req)

const uint16_t attest_size = attestation_cert_der_size;


device_set_status(CTAPHID_STATUS_UPNEEDED);
if ( ! ctap_user_presence_test())
{
return U2F_SW_CONDITIONS_NOT_SATISFIED;
}


if ( u2f_new_keypair(&key_handle, req->app, pubkey) == -1)
{
return U2F_SW_INSUFFICIENT_MEMORY;
@@ -325,8 +328,6 @@ static int16_t u2f_register(struct u2f_register_request * req)

dump_signature_der(sig);

/*printf1(TAG_U2F, "dersig: "); dump_hex1(TAG_U2F,sig,74);*/


return U2F_SW_NO_ERROR;
}
@@ -72,7 +72,7 @@ void TIM6_DAC_IRQHandler()
}
#ifndef IS_BOOTLOADER
// NFC sending WTX if needs
if (device_is_nfc())
if (device_is_nfc() == NFC_IS_ACTIVE)
{
WTX_timer_exec();
}

0 comments on commit 9fb02d4

Please sign in to comment.
You can’t perform that action at this time.