solo1/ctap.h

36 wiersze
957 B
C
Czysty Zwykły widok Historia

2018-05-03 02:52:41 +00:00
#ifndef _CTAP_H
#define _CTAP_H
#define CTAP_MAKE_CREDENTIAL 0x01
#define CTAP_GET_ASSERTION 0x02
#define CTAP_CANCEL 0x03
#define CTAP_GET_INFO 0x04
#define CTAP_CLIENT_PIN 0x06
#define CTAP_RESET 0x07
#define GET_NEXT_ASSERTION 0x08
#define CTAP_VENDOR_FIRST 0x40
#define CTAP_VENDOR_LAST 0xBF
2018-05-04 01:27:29 +00:00
#define CTAP_AAGUID ((uint8_t*)"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff")
2018-05-03 02:52:41 +00:00
typedef struct
{
uint8_t * data;
uint16_t length;
} CTAP_RESPONSE;
2018-05-04 01:27:29 +00:00
uint8_t ctap_handle_packet(uint8_t * pkt_raw, int length, CTAP_RESPONSE * resp);
2018-05-03 02:52:41 +00:00
// Must be implemented by application
// data is HID_MESSAGE_SIZE long in bytes
extern void ctap_write_block(uint8_t * data);
// Buffer data and send in HID_MESSAGE_SIZE chunks
// if len == 0, FLUSH
// if len == -1, RESET
extern void ctap_write(void * _data, int len);
#endif