From eb4a29edc6df7eded990648036ba33c3bd8d9b95 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Fri, 23 Nov 2018 11:51:11 -0500 Subject: [PATCH] update pc build --- pc/device.c | 52 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/pc/device.c b/pc/device.c index fb4d3dc..94d47a0 100644 --- a/pc/device.c +++ b/pc/device.c @@ -14,10 +14,23 @@ #include "cbor.h" #include "util.h" #include "log.h" +#include "ctaphid.h" void authenticator_initialize(); +uint32_t __device_status = 0; +void device_set_status(int status) +{ + if (status != CTAPHID_STATUS_IDLE && __device_status != status) + { + ctaphid_update_status(status); + } + __device_status = status; +} + + + int udp_server() { int fd; @@ -211,15 +224,12 @@ int ctap_generate_rng(uint8_t * dst, size_t num) perror("fopen"); exit(1); } - ret = fread(dst, 1, num, urand); - fclose(urand); - - if (ret != num) + if (fread(dst, 1, num, urand) != num) { - perror("fwrite"); - exit(1); + perror("fread"); } - /*memset(dst,0xaa,num);*/ + + fclose(urand); return 1; } @@ -410,7 +420,31 @@ void authenticator_initialize() } } -void manage_device() +void device_manage() { - + } + +void ctap_reset_rk() +{ +} + +uint32_t ctap_rk_size() +{ + printf("Warning: rk not implemented\n"); + return 0; +} +void ctap_store_rk(int index,CTAP_residentKey * rk) +{ + printf("Warning: rk not implemented\n"); +} +void ctap_load_rk(int index,CTAP_residentKey * rk) +{ + printf("Warning: rk not implemented\n"); +} +void ctap_overwrite_rk(int index,CTAP_residentKey * rk) +{ + printf("Warning: rk not implemented\n"); +} + +