add UP wait HID messages to U2F for windows
This commit is contained in:
parent
e402d36bf1
commit
9fb02d4da3
@ -7,6 +7,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "u2f.h"
|
#include "u2f.h"
|
||||||
#include "ctap.h"
|
#include "ctap.h"
|
||||||
|
#include "ctaphid.h"
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
@ -95,6 +96,8 @@ void u2f_request_ex(APDU_HEADER *req, uint8_t *payload, uint32_t len, CTAP_RESPO
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device_set_status(CTAPHID_STATUS_IDLE);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (rcode != U2F_SW_NO_ERROR)
|
if (rcode != U2F_SW_NO_ERROR)
|
||||||
{
|
{
|
||||||
@ -240,6 +243,7 @@ static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t c
|
|||||||
|
|
||||||
if(up)
|
if(up)
|
||||||
{
|
{
|
||||||
|
device_set_status(CTAPHID_STATUS_UPNEEDED);
|
||||||
if (ctap_user_presence_test() == 0)
|
if (ctap_user_presence_test() == 0)
|
||||||
{
|
{
|
||||||
return U2F_SW_CONDITIONS_NOT_SATISFIED;
|
return U2F_SW_CONDITIONS_NOT_SATISFIED;
|
||||||
@ -286,13 +290,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;
|
||||||
|
|
||||||
|
device_set_status(CTAPHID_STATUS_UPNEEDED);
|
||||||
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)
|
||||||
{
|
{
|
||||||
return U2F_SW_INSUFFICIENT_MEMORY;
|
return U2F_SW_INSUFFICIENT_MEMORY;
|
||||||
@ -325,8 +328,6 @@ static int16_t u2f_register(struct u2f_register_request * req)
|
|||||||
|
|
||||||
dump_signature_der(sig);
|
dump_signature_der(sig);
|
||||||
|
|
||||||
/*printf1(TAG_U2F, "dersig: "); dump_hex1(TAG_U2F,sig,74);*/
|
|
||||||
|
|
||||||
|
|
||||||
return U2F_SW_NO_ERROR;
|
return U2F_SW_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ void TIM6_DAC_IRQHandler()
|
|||||||
}
|
}
|
||||||
#ifndef IS_BOOTLOADER
|
#ifndef IS_BOOTLOADER
|
||||||
// NFC sending WTX if needs
|
// NFC sending WTX if needs
|
||||||
if (device_is_nfc())
|
if (device_is_nfc() == NFC_IS_ACTIVE)
|
||||||
{
|
{
|
||||||
WTX_timer_exec();
|
WTX_timer_exec();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user