added fidocore

This commit is contained in:
merlokk 2018-11-17 16:19:09 +02:00
commit 8f1c67d512
6 changed files with 60 additions and 10 deletions

View file

@ -14,6 +14,7 @@
#include <stdlib.h>
#include "cbor.h"
#include "util.h"
#include "fidocore.h"
static void indent(int nestingLevel) {
while (nestingLevel--)
@ -121,10 +122,6 @@ static CborError dumpelm(CborValue *it, bool *got_next, int nestingLevel) {
return CborNoError;
}
char *getCmdCodeDescription (uint8_t cmdCode, uint8_t memberNum) {
return NULL;
}
static CborError dumprecursive(uint8_t cmdCode, CborValue *it, bool isMapType, int nestingLevel) {
int elmCount = 0;
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)) {
int64_t val;
cbor_value_get_int64(it, &val);
char *desc = getCmdCodeDescription(cmdCode, val);
char *desc = fido2GetCmdMemberDescription(cmdCode, val);
if (desc)
printf(" (%s)", desc);
}

View file

@ -10,7 +10,6 @@
//-----------------------------------------------------------------------------
//
#ifndef __CBORTOOLS_H__
#define __CBORTOOLS_H__

22
client/fido/fidocore.c Normal file
View 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
View 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__ */