mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
added fidocore
This commit is contained in:
parent
f4bb63a728
commit
8f1c67d512
6 changed files with 60 additions and 10 deletions
|
@ -112,6 +112,7 @@ CMDSRCS = crapto1/crapto1.c \
|
||||||
tea.c \
|
tea.c \
|
||||||
fido/additional_ca.c \
|
fido/additional_ca.c \
|
||||||
fido/cbortools.c \
|
fido/cbortools.c \
|
||||||
|
fido/fidocore.c \
|
||||||
crypto/asn1dump.c \
|
crypto/asn1dump.c \
|
||||||
crypto/libpcrypto.c\
|
crypto/libpcrypto.c\
|
||||||
crypto/asn1utils.c\
|
crypto/asn1utils.c\
|
||||||
|
|
|
@ -46,11 +46,10 @@
|
||||||
#include "crypto/libpcrypto.h"
|
#include "crypto/libpcrypto.h"
|
||||||
#include "fido/additional_ca.h"
|
#include "fido/additional_ca.h"
|
||||||
#include "fido/cbortools.h"
|
#include "fido/cbortools.h"
|
||||||
|
#include "fido/fidocore.h"
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
|
|
||||||
#define FIDO2_CMD_INFO 0x04
|
|
||||||
|
|
||||||
int FIDOSelect(bool ActivateField, bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw) {
|
int FIDOSelect(bool ActivateField, bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw) {
|
||||||
uint8_t data[] = {0xA0, 0x00, 0x00, 0x06, 0x47, 0x2F, 0x00, 0x01};
|
uint8_t data[] = {0xA0, 0x00, 0x00, 0x06, 0x47, 0x2F, 0x00, 0x01};
|
||||||
|
|
||||||
|
@ -84,7 +83,7 @@ int FIDOAuthentication(uint8_t *params, uint8_t paramslen, uint8_t controlb, uin
|
||||||
}
|
}
|
||||||
|
|
||||||
int FIDO2GetInfo(uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw) {
|
int FIDO2GetInfo(uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw) {
|
||||||
uint8_t data[] = {FIDO2_CMD_INFO};
|
uint8_t data[] = {fido2CmdGetInfo};
|
||||||
return FIDOExchange((sAPDU){0x80, 0x10, 0x00, 0x00, sizeof(data), data}, Result, MaxResultLen, ResultLen, sw);
|
return FIDOExchange((sAPDU){0x80, 0x10, 0x00, 0x00, sizeof(data), data}, Result, MaxResultLen, ResultLen, sw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +149,7 @@ int CmdHFFidoInfo(const char *cmd) {
|
||||||
|
|
||||||
PrintAndLog("FIDO2 version: (%d)", len);
|
PrintAndLog("FIDO2 version: (%d)", len);
|
||||||
dump_buffer((const unsigned char *)buf, len, NULL, 0);
|
dump_buffer((const unsigned char *)buf, len, NULL, 0);
|
||||||
TinyCborPrintFIDOPackage(FIDO2_CMD_INFO, &buf[1], len - 1);
|
TinyCborPrintFIDOPackage(fido2CmdGetInfo, &buf[1], len - 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "cbor.h"
|
#include "cbor.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "fidocore.h"
|
||||||
|
|
||||||
static void indent(int nestingLevel) {
|
static void indent(int nestingLevel) {
|
||||||
while (nestingLevel--)
|
while (nestingLevel--)
|
||||||
|
@ -121,10 +122,6 @@ static CborError dumpelm(CborValue *it, bool *got_next, int nestingLevel) {
|
||||||
return CborNoError;
|
return CborNoError;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *getCmdCodeDescription (uint8_t cmdCode, uint8_t memberNum) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CborError dumprecursive(uint8_t cmdCode, CborValue *it, bool isMapType, int nestingLevel) {
|
static CborError dumprecursive(uint8_t cmdCode, CborValue *it, bool isMapType, int nestingLevel) {
|
||||||
int elmCount = 0;
|
int elmCount = 0;
|
||||||
while (!cbor_value_at_end(it)) {
|
while (!cbor_value_at_end(it)) {
|
||||||
|
@ -164,7 +161,7 @@ static CborError dumprecursive(uint8_t cmdCode, CborValue *it, bool isMapType, i
|
||||||
if (cmdCode > 0 && nestingLevel == 1 && isMapType && !(elmCount % 2)) {
|
if (cmdCode > 0 && nestingLevel == 1 && isMapType && !(elmCount % 2)) {
|
||||||
int64_t val;
|
int64_t val;
|
||||||
cbor_value_get_int64(it, &val);
|
cbor_value_get_int64(it, &val);
|
||||||
char *desc = getCmdCodeDescription(cmdCode, val);
|
char *desc = fido2GetCmdMemberDescription(cmdCode, val);
|
||||||
if (desc)
|
if (desc)
|
||||||
printf(" (%s)", desc);
|
printf(" (%s)", desc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CBORTOOLS_H__
|
#ifndef __CBORTOOLS_H__
|
||||||
#define __CBORTOOLS_H__
|
#define __CBORTOOLS_H__
|
||||||
|
|
||||||
|
|
22
client/fido/fidocore.c
Normal file
22
client/fido/fidocore.c
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2018 Merlok
|
||||||
|
//
|
||||||
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||||
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||||
|
// the license.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FIDO2 authenticators core data and commands
|
||||||
|
// https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "fidocore.h"
|
||||||
|
|
||||||
|
char *fido2GetCmdMemberDescription(uint8_t cmdCode, uint8_t memberNum) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
32
client/fido/fidocore.h
Normal file
32
client/fido/fidocore.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Copyright (C) 2018 Merlok
|
||||||
|
//
|
||||||
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||||
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||||
|
// the license.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// FIDO2 authenticators core data and commands
|
||||||
|
// https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
#ifndef __FIDOCORE_H__
|
||||||
|
#define __FIDOCORE_H__
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
enum fido2Commands {
|
||||||
|
fido2CmdMakeCredential = 0x01,
|
||||||
|
fido2CmdGetAssertion = 0x02,
|
||||||
|
fido2CmdCancel = 0x03,
|
||||||
|
fido2CmdGetInfo = 0x04,
|
||||||
|
fido2CmdClientPIN = 0x06,
|
||||||
|
fido2CmdReset = 0x07,
|
||||||
|
fido2CmdGetNextAssertion = 0x08,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
extern char *fido2GetCmdMemberDescription(uint8_t cmdCode, uint8_t memberNum);
|
||||||
|
|
||||||
|
#endif /* __FIDOCORE_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue