mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
fido info command completed
This commit is contained in:
parent
23ef267100
commit
12b1289191
3 changed files with 52 additions and 31 deletions
|
@ -147,9 +147,17 @@ int CmdHFFidoInfo(const char *cmd) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLog("FIDO2 version: (%d)", len);
|
if (len > 1) {
|
||||||
dump_buffer((const unsigned char *)buf, len, NULL, 0);
|
// if (false) {
|
||||||
|
// PrintAndLog("FIDO2 version: (len=%d)", len);
|
||||||
|
// dump_buffer((const unsigned char *)buf, len, NULL, 0);
|
||||||
|
// }
|
||||||
|
|
||||||
|
PrintAndLog("FIDO2 version CBOR decoded:");
|
||||||
TinyCborPrintFIDOPackage(fido2CmdGetInfo, &buf[1], len - 1);
|
TinyCborPrintFIDOPackage(fido2CmdGetInfo, &buf[1], len - 1);
|
||||||
|
} else {
|
||||||
|
PrintAndLog("FIDO2 version length error");
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "fidocore.h"
|
#include "fidocore.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t ErrorCode;
|
uint8_t ErrorCode;
|
||||||
char *ShortDescription;
|
char *ShortDescription;
|
||||||
|
@ -69,30 +70,38 @@ fido2Error_t fido2Errors[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
fido2Commands Command;
|
||||||
|
fido2PacketType PckType;
|
||||||
uint8_t MemberNumber;
|
uint8_t MemberNumber;
|
||||||
char *Description;
|
char *Description;
|
||||||
} fido2Desc_t;
|
} fido2Desc_t;
|
||||||
|
|
||||||
typedef fido2Desc_t fido2ArrayDesc_t[];
|
|
||||||
/*
|
|
||||||
typedef struct {
|
|
||||||
fido2Desc_t Query[];
|
|
||||||
fido2Desc_t Resp[];
|
|
||||||
} fido2CmdDesc_t;
|
|
||||||
|
|
||||||
fido2CmdDesc_t fido2CmdDesc[] = { // fido2CommandsCount
|
|
||||||
{fido2CmdGetInfoRespDesc, fido2CmdGetInfoRespDesc},
|
|
||||||
{fido2CmdGetInfoRespDesc, fido2CmdGetInfoRespDesc},
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
fido2Desc_t fido2CmdGetInfoRespDesc[] = {
|
fido2Desc_t fido2CmdGetInfoRespDesc[] = {
|
||||||
{0x01, "versions"},
|
{fido2CmdMakeCredential, ptResponse, 0x01, "fmt"},
|
||||||
{0x02, "extensions"},
|
{fido2CmdMakeCredential, ptResponse, 0x02, "authData"},
|
||||||
{0x03, "aaguid"},
|
{fido2CmdMakeCredential, ptResponse, 0x03, "attStmt"},
|
||||||
{0x04, "options"},
|
|
||||||
{0x05, "maxMsgSize"},
|
{fido2CmdGetAssertion, ptResponse, 0x01, "credential"},
|
||||||
{0x06, "pinProtocols"},
|
{fido2CmdGetAssertion, ptResponse, 0x02, "authData"},
|
||||||
{0xff, ""},
|
{fido2CmdGetAssertion, ptResponse, 0x03, "signature"},
|
||||||
|
{fido2CmdGetAssertion, ptResponse, 0x04, "publicKeyCredentialUserEntity"},
|
||||||
|
{fido2CmdGetAssertion, ptResponse, 0x05, "numberOfCredentials"},
|
||||||
|
|
||||||
|
{fido2CmdGetNextAssertion, ptResponse, 0x01, "credential"},
|
||||||
|
{fido2CmdGetNextAssertion, ptResponse, 0x02, "authData"},
|
||||||
|
{fido2CmdGetNextAssertion, ptResponse, 0x03, "signature"},
|
||||||
|
{fido2CmdGetNextAssertion, ptResponse, 0x04, "publicKeyCredentialUserEntity"},
|
||||||
|
|
||||||
|
{fido2CmdGetInfo, ptResponse, 0x01, "versions"},
|
||||||
|
{fido2CmdGetInfo, ptResponse, 0x02, "extensions"},
|
||||||
|
{fido2CmdGetInfo, ptResponse, 0x03, "aaguid"},
|
||||||
|
{fido2CmdGetInfo, ptResponse, 0x04, "options"},
|
||||||
|
{fido2CmdGetInfo, ptResponse, 0x05, "maxMsgSize"},
|
||||||
|
{fido2CmdGetInfo, ptResponse, 0x06, "pinProtocols"},
|
||||||
|
|
||||||
|
{fido2CmdClientPIN, ptResponse, 0x06, "keyAgreement"},
|
||||||
|
{fido2CmdClientPIN, ptResponse, 0x06, "pinToken"},
|
||||||
|
{fido2CmdClientPIN, ptResponse, 0x06, "retries"},
|
||||||
};
|
};
|
||||||
|
|
||||||
char *fido2GetCmdErrorDescription(uint8_t errorCode) {
|
char *fido2GetCmdErrorDescription(uint8_t errorCode) {
|
||||||
|
@ -104,9 +113,11 @@ char *fido2GetCmdErrorDescription(uint8_t errorCode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *fido2GetCmdMemberDescription(uint8_t cmdCode, uint8_t memberNum) {
|
char *fido2GetCmdMemberDescription(uint8_t cmdCode, uint8_t memberNum) {
|
||||||
|
for (int i = 0; i < sizeof(fido2CmdGetInfoRespDesc) / sizeof(fido2Desc_t); i++)
|
||||||
|
if (fido2CmdGetInfoRespDesc[i].Command == cmdCode &&
|
||||||
|
fido2CmdGetInfoRespDesc[i].PckType == ptResponse &&
|
||||||
|
fido2CmdGetInfoRespDesc[i].MemberNumber == memberNum )
|
||||||
|
return fido2CmdGetInfoRespDesc[i].Description;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
enum fido2Commands {
|
typedef enum {
|
||||||
fido2CmdMakeCredential = 0x01,
|
fido2CmdMakeCredential = 0x01,
|
||||||
fido2CmdGetAssertion = 0x02,
|
fido2CmdGetAssertion = 0x02,
|
||||||
fido2CmdCancel = 0x03,
|
fido2CmdCancel = 0x03,
|
||||||
|
@ -23,10 +23,12 @@ enum fido2Commands {
|
||||||
fido2CmdClientPIN = 0x06,
|
fido2CmdClientPIN = 0x06,
|
||||||
fido2CmdReset = 0x07,
|
fido2CmdReset = 0x07,
|
||||||
fido2CmdGetNextAssertion = 0x08,
|
fido2CmdGetNextAssertion = 0x08,
|
||||||
};
|
} fido2Commands;
|
||||||
#define fido2CommandsCount 9
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ptQuery,
|
||||||
|
ptResponse,
|
||||||
|
} fido2PacketType;
|
||||||
|
|
||||||
extern char *fido2GetCmdMemberDescription(uint8_t cmdCode, uint8_t memberNum);
|
extern char *fido2GetCmdMemberDescription(uint8_t cmdCode, uint8_t memberNum);
|
||||||
extern char *fido2GetCmdErrorDescription(uint8_t errorCode);
|
extern char *fido2GetCmdErrorDescription(uint8_t errorCode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue