pin auth working

This commit is contained in:
Conor Patrick
2018-07-08 22:36:16 -04:00
parent 7df04964cc
commit b9220defcc
18 changed files with 10706 additions and 993 deletions

View File

@@ -11,6 +11,7 @@ static int16_t u2f_register(struct u2f_register_request * req);
static int16_t u2f_version();
static int16_t u2f_authenticate(struct u2f_authenticate_request * req, uint8_t control);
int8_t u2f_response_writeback(const uint8_t * buf, uint16_t len);
void u2f_reset_response();
static CTAP_RESPONSE * _u2f_resp = NULL;
@@ -30,23 +31,23 @@ void u2f_request(struct u2f_request_apdu* req, CTAP_RESPONSE * resp)
goto end;
}
#ifdef BRIDGE_TO_WALLET
struct u2f_authenticate_request * auth = (struct u2f_register_request *) req->payload;
struct u2f_authenticate_request * auth = (struct u2f_authenticate_request *) req->payload;
if (req->ins == U2F_AUTHENTICATE)
{
if (req->p1 == U2F_AUTHENTICATE_CHECK)
{
// if (u2f_appid_eq(&req->kh, req->app) == 0)
// {
// rcode = U2F_SW_CONDITIONS_NOT_SATISFIED;
// if (u2f_appid_eq(&req->kh, req->app) == 0)
// {
// rcode = U2F_SW_CONDITIONS_NOT_SATISFIED;
// }
// else
// {
rcode = U2F_SW_WRONG_DATA;
// }
// {
rcode = U2F_SW_WRONG_DATA;
// }
}
else
{
rcode = bridge_u2f_to_wallet(auth->chal, auth->app, auth->khl, &auth->kh);
rcode = bridge_u2f_to_wallet(auth->chal, auth->app, auth->khl, &auth->kh);
}
}
else if (req->ins == U2F_VERSION)
@@ -140,6 +141,10 @@ int8_t u2f_response_writeback(const uint8_t * buf, uint16_t len)
return 0;
}
void u2f_reset_response()
{
ctap_response_init(_u2f_resp);
}
static void dump_signature_der(uint8_t * sig)