]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/fido/fidocore.h
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2018 Merlok
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
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 //-----------------------------------------------------------------------------
12 #ifndef __FIDOCORE_H__
13 #define __FIDOCORE_H__
19 #include "emv/emvcore.h"
22 fido2CmdMakeCredential
= 0x01,
23 fido2CmdGetAssertion
= 0x02,
24 fido2CmdCancel
= 0x03,
25 fido2CmdGetInfo
= 0x04,
26 fido2CmdClientPIN
= 0x06,
28 fido2CmdGetNextAssertion
= 0x08,
39 extern int FIDOSelect(bool ActivateField
, bool LeaveFieldON
, uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
40 extern int FIDOExchange(uint8_t *APDU
, int APDU_len
, uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
41 extern int FIDORegister(uint8_t *params
, uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
42 extern int FIDOAuthentication(uint8_t *params
, uint8_t paramslen
, uint8_t controlb
, uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
43 extern int FIDO2GetInfo(uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
44 extern int FIDO2MakeCredential(uint8_t *params
, uint8_t paramslen
, uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
45 extern int FIDO2GetAssertion(uint8_t *params
, uint8_t paramslen
, uint8_t *Result
, size_t MaxResultLen
, size_t *ResultLen
, uint16_t *sw
);
47 extern int FIDOCheckDERAndGetKey(uint8_t *der
, size_t derLen
, bool verbose
, uint8_t *publicKey
, size_t publicKeyMaxLen
);
49 extern char *fido2GetCmdMemberDescription(uint8_t cmdCode
, bool isResponse
, int memberNum
);
50 extern char *fido2GetCmdErrorDescription(uint8_t errorCode
);
52 extern bool CheckrpIdHash(json_t
*json
, uint8_t *hash
);
53 extern int FIDO2CreateMakeCredentionalReq(json_t
*root
, uint8_t *data
, size_t maxdatalen
, size_t *datalen
);
54 extern int FIDO2MakeCredentionalParseRes(json_t
*root
, uint8_t *data
, size_t dataLen
, bool verbose
, bool verbose2
, bool showCBOR
, bool showDERTLV
);
55 extern int FIDO2CreateGetAssertionReq(json_t
*root
, uint8_t *data
, size_t maxdatalen
, size_t *datalen
, bool createAllowList
);
56 extern int FIDO2GetAssertionParseRes(json_t
*root
, uint8_t *data
, size_t dataLen
, bool verbose
, bool verbose2
, bool showCBOR
);
58 #endif /* __FIDOCORE_H__ */