src/emv_sda.c File Reference

#include <ccid.h>
#include <list.h>
#include <emv.h>
#include <ber.h>
#include "emv-internal.h"
Include dependency graph for emv_sda.c:

Go to the source code of this file.

Data Structures

struct  sda_req

Functions

static int get_required_data (struct _emv *e, struct sda_req *req)
static RSA * get_ca_key (unsigned int idx, emv_mod_cb_t mod, emv_exp_cb_t exp, size_t *key_len, void *priv)
static int recover (uint8_t *ptr, size_t len, RSA *key)
static int check_pk_cert (struct _emv *e, struct sda_req *req)
static RSA * make_issuer_pk (struct _emv *e, struct sda_req *req)
static RSA * get_issuer_pk (struct _emv *e, struct sda_req *req, RSA *ca_key, size_t key_len)
static int check_ssa (struct _emv *e, const uint8_t *ptr, size_t len, struct _emv_data **rec, unsigned int num, const uint8_t *aip)
static int verify_ssa_data (struct _emv *e, struct _emv_data **rec, unsigned int num_rec, struct sda_req *req, RSA *iss_key, const uint8_t *aip)
int emv_authenticate_static_data (emv_t e, emv_mod_cb_t mod, emv_exp_cb_t exp, void *priv)
int emv_sda_ok (emv_t e)

Function Documentation

static int check_pk_cert ( struct _emv e,
struct sda_req req 
) [static]

Definition at line 130 of file emv_sda.c.

References _emsa_pss_decode(), _emv_error(), _emv_sys_error(), EMV_ERR_CERTIFICATE, sda_req::pk_cert, sda_req::pk_cert_len, sda_req::pk_exp, sda_req::pk_exp_len, sda_req::pk_r, and sda_req::pk_r_len.

Referenced by get_issuer_pk().

Here is the call graph for this function:

Here is the caller graph for this function:

static int check_ssa ( struct _emv e,
const uint8_t *  ptr,
size_t  len,
struct _emv_data **  rec,
unsigned int  num,
const uint8_t *  aip 
) [static]

Definition at line 239 of file emv_sda.c.

References _emsa_pss_decode(), _emv_error(), _emv_sys_error(), _emv_data::d_data, _emv_data::d_len, EMV_ERR_SSA_SIGNATURE, and hex_dump().

Referenced by verify_ssa_data().

Here is the call graph for this function:

Here is the caller graph for this function:

int emv_authenticate_static_data ( emv_t  e,
emv_mod_cb_t  mod,
emv_exp_cb_t  exp,
void *  priv 
)
int emv_sda_ok ( emv_t  e  ) 

Definition at line 355 of file emv_sda.c.

References _emv::e_sda_ok.

static RSA* get_ca_key ( unsigned int  idx,
emv_mod_cb_t  mod,
emv_exp_cb_t  exp,
size_t *  key_len,
void *  priv 
) [static]

Definition at line 72 of file emv_sda.c.

References exp_len, and mod_len.

Referenced by emv_authenticate_static_data().

Here is the caller graph for this function:

static RSA* get_issuer_pk ( struct _emv e,
struct sda_req req,
RSA *  ca_key,
size_t  key_len 
) [static]

Definition at line 216 of file emv_sda.c.

References _emv_error(), check_pk_cert(), EMV_ERR_KEY_SIZE_MISMATCH, EMV_ERR_RSA_RECOVERY, make_issuer_pk(), sda_req::pk_cert, sda_req::pk_cert_len, and recover().

Referenced by emv_authenticate_static_data().

Here is the call graph for this function:

Here is the caller graph for this function:

static int get_required_data ( struct _emv e,
struct sda_req req 
) [static]
static RSA* make_issuer_pk ( struct _emv e,
struct sda_req req 
) [static]

Definition at line 177 of file emv_sda.c.

References _emv_sys_error(), hex_dump(), sda_req::pk_cert, sda_req::pk_cert_len, sda_req::pk_exp, sda_req::pk_exp_len, sda_req::pk_r, and sda_req::pk_r_len.

Referenced by get_issuer_pk().

Here is the call graph for this function:

Here is the caller graph for this function:

static int recover ( uint8_t *  ptr,
size_t  len,
RSA *  key 
) [static]

Definition at line 109 of file emv_sda.c.

Referenced by get_issuer_pk(), and verify_ssa_data().

Here is the caller graph for this function:

static int verify_ssa_data ( struct _emv e,
struct _emv_data **  rec,
unsigned int  num_rec,
struct sda_req req,
RSA *  iss_key,
const uint8_t *  aip 
) [static]

Definition at line 287 of file emv_sda.c.

References _emv_error(), check_ssa(), EMV_ERR_RSA_RECOVERY, EMV_ERR_SSA_SIGNATURE, recover(), sda_req::ssa_data, and sda_req::ssa_data_len.

Referenced by emv_authenticate_static_data().

Here is the call graph for this function:

Here is the caller graph for this function:

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