Use our cifra fork, rename command, keep room for sha256
This commit is contained in:
parent
0c296bba30
commit
a6673b0917
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -15,4 +15,4 @@
|
|||||||
url = https://github.com/solokeys/dfuse-tool
|
url = https://github.com/solokeys/dfuse-tool
|
||||||
[submodule "crypto/cifra"]
|
[submodule "crypto/cifra"]
|
||||||
path = crypto/cifra
|
path = crypto/cifra
|
||||||
url = https://github.com/ctz/cifra.git
|
url = https://github.com/solokeys/cifra.git
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
|
|
||||||
// move custom HASH512 command out,
|
// move custom SHA512 command out,
|
||||||
// and the following headers too
|
// and the following headers too
|
||||||
#include "sha2.h"
|
#include "sha2.h"
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
@ -726,15 +726,15 @@ uint8_t ctaphid_handle_packet(uint8_t * pkt_raw)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(SOLO_HACKER)
|
#if defined(SOLO_HACKER)
|
||||||
case CTAPHID_HASH512:
|
case CTAPHID_SHA512:
|
||||||
// some random logging
|
// some random logging
|
||||||
printf1(TAG_HID,"CTAPHID_HASH512\n");
|
printf1(TAG_HID,"CTAPHID_SHA512\n");
|
||||||
// initialise CTAP response object
|
// initialise CTAP response object
|
||||||
ctap_response_init(&ctap_resp);
|
ctap_response_init(&ctap_resp);
|
||||||
// initialise write buffer
|
// initialise write buffer
|
||||||
ctaphid_write_buffer_init(&wb);
|
ctaphid_write_buffer_init(&wb);
|
||||||
wb.cid = cid;
|
wb.cid = cid;
|
||||||
wb.cmd = CTAPHID_HASH512;
|
wb.cmd = CTAPHID_SHA512;
|
||||||
wb.bcnt = CF_SHA512_HASHSZ; // 64 bytes
|
wb.bcnt = CF_SHA512_HASHSZ; // 64 bytes
|
||||||
// calculate hash
|
// calculate hash
|
||||||
crypto_sha512_init();
|
crypto_sha512_init();
|
||||||
|
@ -28,7 +28,8 @@
|
|||||||
#define CTAPHID_ENTERBOOT (TYPE_INIT | 0x51)
|
#define CTAPHID_ENTERBOOT (TYPE_INIT | 0x51)
|
||||||
#define CTAPHID_ENTERSTBOOT (TYPE_INIT | 0x52)
|
#define CTAPHID_ENTERSTBOOT (TYPE_INIT | 0x52)
|
||||||
#define CTAPHID_GETRNG (TYPE_INIT | 0x60)
|
#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_CMD 0x01
|
||||||
#define ERR_INVALID_PAR 0x02
|
#define ERR_INVALID_PAR 0x02
|
||||||
|
Loading…
x
Reference in New Issue
Block a user