CCID Transaction Buffer

Provides: More...

Typedefs

typedef struct _xfrxfr_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.

Detailed Description

Provides:

  1. An appropriately sized send/receive buffer for a CCID.
  2. An interface for constructing requests.
  3. An interface for retreiving status words and retrieved data.

Typedef Documentation

typedef struct _xfr* xfr_t

Transaction Buffer.

Definition at line 65 of file ccid.h.


Function Documentation

xfr_t xfr_alloc ( size_t  txbuf,
size_t  rxbuf 
)

Allocate a transaction buffer.

Parameters:
txbuf Size of transmit buffer in bytes.
rxbuf Size of receive buffer in bytes.
Returns:
xfr_t representing the transaction buffer.

Definition at line 53 of file xfr.c.

References _xfr_do_alloc().

Referenced by cp_xfr_init(), emv_init(), and sim_new().

Here is the call graph for this function:

Here is the caller graph for this function:

void xfr_free ( xfr_t  xfr  ) 

Free a transaction buffer.

Parameters:
xfr xfr_t representing the transaction buffer.
Returns:
zero on error.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void xfr_reset ( xfr_t  xfr  ) 

Reset a transaction buffer buffer.

Parameters:
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().

Here is the caller graph for this function:

const uint8_t* xfr_rx_data ( xfr_t  xfr,
size_t *  len 
)

Retrieve data portion of the receive buffer.

Parameters:
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.

Returns:
NULL on error, pointer to data bytes on error.

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().

Here is the caller graph for this function:

uint8_t xfr_rx_sw1 ( xfr_t  xfr  ) 

Retrieve status word 1 from the receive buffer.

Parameters:
xfr xfr_t representing the transaction buffer. Return value is only valid after a successful transaction
Returns:
value of status byte.

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().

Here is the caller graph for this function:

uint8_t xfr_rx_sw2 ( xfr_t  xfr  ) 

Retrieve status word 2 from the receive buffer.

Parameters:
xfr xfr_t representing the transaction buffer. Return value is only valid after a successful transaction
Returns:
zero on error.

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().

Here is the caller graph for this function:

int xfr_tx_buf ( xfr_t  xfr,
const uint8_t *  ptr,
size_t  len 
)

Append a string of bytes to the transmit buffer.

Parameters:
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.

Returns:
zero on error.

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().

Here is the caller graph for this function:

int xfr_tx_byte ( xfr_t  xfr,
uint8_t  byte 
)

Append a byte of data to the transmit buffer.

Parameters:
xfr xfr_t representing the transaction buffer.
byte Byte to append
Returns:
zero on error.

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().

Here is the caller graph for this function:

Generated on Sun Jan 2 08:36:08 2011 for ccid-utils by  doxygen 1.6.3