Provides: More...
Typedefs | |
typedef struct _xfr * | xfr_t |
Transaction Buffer. | |
Functions | |
xfr_t | xfr_alloc (size_t txbuf, size_t rxbuf) |
Allocate a transaction buffer. | |
void | xfr_reset (xfr_t xfr) |
Reset a transaction buffer buffer. | |
int | xfr_tx_byte (xfr_t xfr, uint8_t byte) |
Append a byte of data to the transmit buffer. | |
int | xfr_tx_buf (xfr_t xfr, const uint8_t *ptr, size_t len) |
Append a string of bytes to the transmit buffer. | |
uint8_t | xfr_rx_sw1 (xfr_t xfr) |
Retrieve status word 1 from the receive buffer. | |
uint8_t | xfr_rx_sw2 (xfr_t xfr) |
Retrieve status word 2 from the receive buffer. | |
const uint8_t * | xfr_rx_data (xfr_t xfr, size_t *len) |
Retrieve data portion of the receive buffer. | |
void | xfr_free (xfr_t xfr) |
Free a transaction buffer. |
Provides:
xfr_t xfr_alloc | ( | size_t | txbuf, | |
size_t | rxbuf | |||
) |
Allocate a transaction buffer.
txbuf | Size of transmit buffer in bytes. | |
rxbuf | Size of receive buffer in bytes. |
Definition at line 53 of file xfr.c.
References _xfr_do_alloc().
Referenced by cp_xfr_init(), emv_init(), and sim_new().
void xfr_free | ( | xfr_t | xfr | ) |
Free a transaction buffer.
xfr | xfr_t representing the transaction buffer. |
Definition at line 165 of file xfr.c.
References _xfr_do_free().
Referenced by cp_xfr_dealloc(), do_emv_fini(), sim_free(), and sim_new().
void xfr_reset | ( | xfr_t | xfr | ) |
Reset a transaction buffer buffer.
xfr | xfr_t representing the transaction buffer. |
Empty the buffer of any send or receive data.
Definition at line 64 of file xfr.c.
References _xfr::x_rxlen, and _xfr::x_txlen.
Referenced by _apdu_read_binary(), _apdu_read_record(), _emv_generate_ac(), _emv_get_data(), _emv_get_proc_opts(), _emv_int_authenticate(), _emv_read_record(), _emv_verify(), cp_xfr_reset(), do_get_response(), do_sel(), and do_select().
const uint8_t* xfr_rx_data | ( | xfr_t | xfr, | |
size_t * | len | |||
) |
Retrieve data portion of the receive buffer.
xfr | xfr_t representing the transaction buffer. | |
len | Pointer to size_t in which to store length of buffer. |
Return value is only valid after a successful transaction, the contents of the buffer may be overwritten with new data after an other transaction has been processed on xfr.
Definition at line 147 of file xfr.c.
References MIN_RESP_LEN, _xfr::x_rxbuf, and _xfr::x_rxlen.
Referenced by _sim_read_binary(), _sim_read_record(), add_app(), atc(), cp_xfr_data(), emv_generate_ac(), get_aip(), ptc(), read_sfi(), set_app(), set_fci(), and verify_dynamic_sig().
uint8_t xfr_rx_sw1 | ( | xfr_t | xfr | ) |
Retrieve status word 1 from the receive buffer.
xfr | xfr_t representing the transaction buffer. Return value is only valid after a successful transaction |
Definition at line 114 of file xfr.c.
References MIN_RESP_LEN, _xfr::x_rxbuf, and _xfr::x_rxlen.
Referenced by _apdu_read_binary(), _apdu_read_record(), _apdu_select(), _emv_generate_ac(), _emv_get_data(), _emv_get_proc_opts(), _emv_int_authenticate(), _emv_read_record(), _emv_sw1(), _emv_verify(), cp_chipcard_transact(), cp_xfr_sw1(), and do_sel().
uint8_t xfr_rx_sw2 | ( | xfr_t | xfr | ) |
Retrieve status word 2 from the receive buffer.
xfr | xfr_t representing the transaction buffer. Return value is only valid after a successful transaction |
Definition at line 128 of file xfr.c.
References MIN_RESP_LEN, _xfr::x_rxbuf, and _xfr::x_rxlen.
Referenced by _apdu_select(), _emv_generate_ac(), _emv_get_data(), _emv_get_proc_opts(), _emv_int_authenticate(), _emv_read_record(), _emv_sw2(), cp_xfr_sw2(), and do_sel().
int xfr_tx_buf | ( | xfr_t | xfr, | |
const uint8_t * | ptr, | |||
size_t | len | |||
) |
Append a string of bytes to the transmit buffer.
xfr | xfr_t representing the transaction buffer. | |
ptr | Pointer to buffer containing bytes to transmit. | |
len | Number of bytes in the buffer. |
Data is copied so that the buffer that ptr refers to may be safely freed after the function has returned.
Definition at line 97 of file xfr.c.
References _xfr::x_txbuf, _xfr::x_txlen, and _xfr::x_txmax.
Referenced by _emv_generate_ac(), _emv_get_proc_opts(), _emv_int_authenticate(), _emv_verify(), cp_xfr_str(), and do_sel().
int xfr_tx_byte | ( | xfr_t | xfr, | |
uint8_t | byte | |||
) |
Append a byte of data to the transmit buffer.
xfr | xfr_t representing the transaction buffer. | |
byte | Byte to append |
Definition at line 75 of file xfr.c.
References _xfr::x_txbuf, _xfr::x_txlen, and _xfr::x_txmax.
Referenced by _apdu_read_binary(), _apdu_read_record(), _emv_generate_ac(), _emv_get_data(), _emv_get_proc_opts(), _emv_int_authenticate(), _emv_read_record(), _emv_verify(), cp_xfr_byte(), do_get_response(), do_sel(), and do_select().