start ctap protocol

This commit is contained in:
Conor Patrick
2018-05-02 22:52:41 -04:00
parent ac3e3da68b
commit 3080007b12
7 changed files with 231 additions and 143 deletions

14
main.c
View File

@@ -8,7 +8,7 @@
#include "util.h"
void check_ret(CborError ret)
static void check_ret(CborError ret)
{
if (ret != CborNoError)
{
@@ -18,14 +18,6 @@ void check_ret(CborError ret)
}
void ctaphid_write_block(uint8_t * data)
{
printf("usbhid send\n");
dump_hex(data, 64);
usbhid_send(data);
}
int main(int argc, char * argv[])
{
/*CborError ret;*/
@@ -45,7 +37,6 @@ int main(int argc, char * argv[])
int count = 0;
uint8_t hidmsg[64];
CTAPHID_STATUS res;
memset(hidmsg,0,sizeof(hidmsg));
printf("recv'ing hid msg \n");
@@ -55,9 +46,8 @@ int main(int argc, char * argv[])
usbhid_recv(hidmsg);
printf("%d>> ",count++); dump_hex(hidmsg,sizeof(hidmsg));
ctaphid_handle_packet(hidmsg, &res);
ctaphid_handle_packet(hidmsg);
memset(hidmsg, 0, sizeof(hidmsg));
ctaphid_dump_status(&res);
/*int i;*/
/*for(i = 0; i < res.length; i += 64)*/