From a382ab5e429ba5d50fa064fbe4845f365a27d61f Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sat, 12 May 2018 12:23:14 -0400 Subject: [PATCH] fix error with double HID response --- ctap.c | 2 +- ctaphid.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctap.c b/ctap.c index ab78ef2..d780673 100644 --- a/ctap.c +++ b/ctap.c @@ -763,7 +763,7 @@ void ctap_make_credential(CborEncoder * encoder, uint8_t * request, int length) printf("der sig [%d]: ", sigder_sz); dump_hex(sigder, sigder_sz); - ctap_add_attest_statement(&map, sigder, sigderlen); + ctap_add_attest_statement(&map, sigder, sigder_sz); ret = cbor_encoder_close_container(encoder, &map); check_ret(ret); diff --git a/ctaphid.c b/ctaphid.c index aa0bb00..2999653 100644 --- a/ctaphid.c +++ b/ctaphid.c @@ -185,7 +185,7 @@ static int buffer_len() static void ctaphid_write(CTAPHID_WRITE_BUFFER * wb, void * _data, int len) { uint8_t * data = (uint8_t *)_data; - if (len == 0) + if (_data == NULL) { if (wb->offset == 0 && wb->bytes_written == 0) {