From a6673b09178a353f6acc18157283bee962640538 Mon Sep 17 00:00:00 2001 From: Nicolas Stalder Date: Tue, 26 Feb 2019 19:31:14 +0100 Subject: [PATCH] Use our cifra fork, rename command, keep room for sha256 --- .gitmodules | 2 +- fido2/ctaphid.c | 8 ++++---- fido2/ctaphid.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitmodules b/.gitmodules index 8f2ea4e..35886ad 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,4 +15,4 @@ url = https://github.com/solokeys/dfuse-tool [submodule "crypto/cifra"] path = crypto/cifra - url = https://github.com/ctz/cifra.git + url = https://github.com/solokeys/cifra.git diff --git a/fido2/ctaphid.c b/fido2/ctaphid.c index 0885ed9..6452cde 100644 --- a/fido2/ctaphid.c +++ b/fido2/ctaphid.c @@ -17,7 +17,7 @@ #include "log.h" #include "extensions.h" -// move custom HASH512 command out, +// move custom SHA512 command out, // and the following headers too #include "sha2.h" #include "crypto.h" @@ -726,15 +726,15 @@ uint8_t ctaphid_handle_packet(uint8_t * pkt_raw) break; #endif #if defined(SOLO_HACKER) - case CTAPHID_HASH512: + case CTAPHID_SHA512: // some random logging - printf1(TAG_HID,"CTAPHID_HASH512\n"); + printf1(TAG_HID,"CTAPHID_SHA512\n"); // initialise CTAP response object ctap_response_init(&ctap_resp); // initialise write buffer ctaphid_write_buffer_init(&wb); wb.cid = cid; - wb.cmd = CTAPHID_HASH512; + wb.cmd = CTAPHID_SHA512; wb.bcnt = CF_SHA512_HASHSZ; // 64 bytes // calculate hash crypto_sha512_init(); diff --git a/fido2/ctaphid.h b/fido2/ctaphid.h index b728b0f..7224ca5 100644 --- a/fido2/ctaphid.h +++ b/fido2/ctaphid.h @@ -28,7 +28,8 @@ #define CTAPHID_ENTERBOOT (TYPE_INIT | 0x51) #define CTAPHID_ENTERSTBOOT (TYPE_INIT | 0x52) #define CTAPHID_GETRNG (TYPE_INIT | 0x60) -#define CTAPHID_HASH512 (TYPE_INIT | 0x70) +#define CTAPHID_SHA256 (TYPE_INIT | 0x70) // not implemented +#define CTAPHID_SHA512 (TYPE_INIT | 0x71) #define ERR_INVALID_CMD 0x01 #define ERR_INVALID_PAR 0x02