|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <stdint.h>#include <stdbool.h>#include <stddef.h>Go to the source code of this file.
Functions | |
| struct | __attribute__ ((packed)) |
| bool | ccid_init (void) |
| int | ccid_process_message (const uint8_t *msg, size_t msg_len, uint8_t *resp, size_t resp_max) |
| Processes one incoming CCID message and writes corresponding response. | |
| const uint8_t * | ccid_get_atr (size_t *len) |
| Returns pointer and length of ATR bytes. | |
| bool | ccid_card_present (void) |
| Returns whether virtual CCID card is available. | |
Variables | |
| ccid_header_t | |
| const uint8_t | CCID_DESCRIPTOR [] |
| CCID functional descriptor (54 bytes) per OpenPGP 3.4.1 profile. | |
| const size_t | CCID_DESCRIPTOR_LEN |
| #define CCID_CMD_STATUS_FAILED 0x40 |
Definition at line 49 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_ERROR_CMD_NOT_SUPPORTED 0x00 |
Definition at line 58 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_ERROR_HW_ERROR 0xFB |
Definition at line 57 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_ERROR_XFR_OVERRUN 0xFC |
Definition at line 56 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_HEADER_SIZE 10 |
Definition at line 62 of file ccid.h.
Referenced by ccid_driver_xfer_cb(), and ccid_process_message().
| #define CCID_ICC_PRESENT_ACTIVE 0x00 |
Definition at line 43 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_ICC_PRESENT_INACTIVE 0x01 |
Definition at line 44 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_PC_TO_RDR_GET_PARAMETERS 0x6C |
Definition at line 32 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_PC_TO_RDR_GET_SLOT_STATUS 0x65 |
Definition at line 30 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_PC_TO_RDR_ICC_POWER_OFF 0x63 |
Definition at line 29 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_PC_TO_RDR_ICC_POWER_ON 0x62 |
Definition at line 28 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_PC_TO_RDR_RESET_PARAMETERS 0x6D |
Definition at line 33 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_PC_TO_RDR_XFR_BLOCK 0x6F |
Definition at line 31 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_RDR_TO_PC_DATA_BLOCK 0x80 |
Definition at line 38 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_RDR_TO_PC_PARAMETERS 0x82 |
Definition at line 40 of file ccid.h.
Referenced by ccid_process_message().
| #define CCID_RDR_TO_PC_SLOT_STATUS 0x81 |
Definition at line 39 of file ccid.h.
Referenced by ccid_process_message().
| bool ccid_card_present | ( | void | ) |
Returns whether virtual CCID card is available.
Definition at line 112 of file ccid.cpp.
References initialized.
| const uint8_t * ccid_get_atr | ( | size_t * | len | ) |
Returns pointer and length of ATR bytes.
| len | Optional output receiving ATR length. |
Definition at line 101 of file ccid.cpp.
References ATR.
Referenced by ccid_process_message().
| bool ccid_init | ( | void | ) |
Definition at line 83 of file ccid.cpp.
References ccid_driver_link_anchor(), initialized, LOG_E, LOG_I, openpgp_init(), and TAG.
Referenced by cdc::mod_gpg::GpgModule::start().
| int ccid_process_message | ( | const uint8_t * | msg, |
| size_t | msg_len, | ||
| uint8_t * | resp, | ||
| size_t | resp_max ) |
Processes one incoming CCID message and writes corresponding response.
| Message transfer (badge-to-badge) | Incoming CCID message bytes. |
| msg_len | Incoming message length. |
| resp | Output response buffer. |
| resp_max | Output buffer capacity. |
Definition at line 148 of file ccid.cpp.
References ccid_build_header(), CCID_CMD_STATUS_FAILED, CCID_ERROR_CMD_NOT_SUPPORTED, CCID_ERROR_HW_ERROR, CCID_ERROR_XFR_OVERRUN, ccid_get_atr(), CCID_HEADER_SIZE, ccid_header_t, CCID_ICC_PRESENT_ACTIVE, CCID_ICC_PRESENT_INACTIVE, CCID_PC_TO_RDR_GET_PARAMETERS, CCID_PC_TO_RDR_GET_SLOT_STATUS, CCID_PC_TO_RDR_ICC_POWER_OFF, CCID_PC_TO_RDR_ICC_POWER_ON, CCID_PC_TO_RDR_RESET_PARAMETERS, CCID_PC_TO_RDR_XFR_BLOCK, CCID_RDR_TO_PC_DATA_BLOCK, CCID_RDR_TO_PC_PARAMETERS, CCID_RDR_TO_PC_SLOT_STATUS, current_seq, current_slot, LOG_E, LOG_I, LOG_W, openpgp_process_apdu(), and TAG.
Referenced by ccid_driver_xfer_cb().
|
extern |
| ccid_header_t |
Definition at line 71 of file ccid.h.
Referenced by ccid_process_message().