]> git.zerfleddert.de Git - proxmark3-svn/blame - client/fido/fidocore.h
Code improved for less memory
[proxmark3-svn] / client / fido / fidocore.h
CommitLineData
0bb51450
OM
1//-----------------------------------------------------------------------------
2// Copyright (C) 2018 Merlok
3//
4// This code is licensed to you under the terms of the GNU GPL, version 2 or,
5// at your option, any later version. See the LICENSE.txt file for the text of
6// the license.
7//-----------------------------------------------------------------------------
8// FIDO2 authenticators core data and commands
9// https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html
10//-----------------------------------------------------------------------------
11//
12#ifndef __FIDOCORE_H__
13#define __FIDOCORE_H__
14
15#include <stddef.h>
16#include <stdint.h>
17#include <jansson.h>
18#include "cmdhf14a.h"
19#include "emv/emvcore.h"
20
21typedef enum {
22 fido2CmdMakeCredential = 0x01,
23 fido2CmdGetAssertion = 0x02,
24 fido2CmdCancel = 0x03,
25 fido2CmdGetInfo = 0x04,
26 fido2CmdClientPIN = 0x06,
27 fido2CmdReset = 0x07,
28 fido2CmdGetNextAssertion = 0x08,
29
30 // another data
31 fido2COSEKey = 0xF0
32} fido2Commands;
33
34typedef enum {
35 ptQuery,
36 ptResponse,
37} fido2PacketType;
38
39extern int FIDOSelect(bool ActivateField, bool LeaveFieldON, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
6b5105be 40extern int FIDOExchange(uint8_t *APDU, int APDU_len, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
0bb51450
OM
41extern int FIDORegister(uint8_t *params, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
42extern int FIDOAuthentication(uint8_t *params, uint8_t paramslen, uint8_t controlb, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
43extern int FIDO2GetInfo(uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
44extern int FIDO2MakeCredential(uint8_t *params, uint8_t paramslen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
45extern int FIDO2GetAssertion(uint8_t *params, uint8_t paramslen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw);
46
47extern int FIDOCheckDERAndGetKey(uint8_t *der, size_t derLen, bool verbose, uint8_t *publicKey, size_t publicKeyMaxLen);
48
49extern char *fido2GetCmdMemberDescription(uint8_t cmdCode, bool isResponse, int memberNum);
50extern char *fido2GetCmdErrorDescription(uint8_t errorCode);
51
52extern bool CheckrpIdHash(json_t *json, uint8_t *hash);
53extern int FIDO2CreateMakeCredentionalReq(json_t *root, uint8_t *data, size_t maxdatalen, size_t *datalen);
54extern int FIDO2MakeCredentionalParseRes(json_t *root, uint8_t *data, size_t dataLen, bool verbose, bool verbose2, bool showCBOR, bool showDERTLV);
55extern int FIDO2CreateGetAssertionReq(json_t *root, uint8_t *data, size_t maxdatalen, size_t *datalen, bool createAllowList);
56extern int FIDO2GetAssertionParseRes(json_t *root, uint8_t *data, size_t dataLen, bool verbose, bool verbose2, bool showCBOR);
57
58#endif /* __FIDOCORE_H__ */
Impressum, Datenschutz