#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <winscard.h>
#include "common.h"
#include "wpa_supplicant.h"
#include "pcsc_funcs.h"
Include dependency graph for pcsc_funcs.c:
Go to the source code of this file.
Defines | |
#define | SIM_CMD_SELECT 0xa0, 0xa4, 0x00, 0x00, 0x02 |
#define | SIM_CMD_RUN_GSM_ALG 0xa0, 0x88, 0x00, 0x00, 0x10 |
#define | SIM_CMD_GET_RESPONSE 0xa0, 0xc0, 0x00, 0x00 |
#define | SIM_CMD_READ_BIN 0xa0, 0xb0, 0x00, 0x00 |
#define | SIM_CMD_VERIFY_CHV1 0xa0, 0x20, 0x00, 0x01, 0x08 |
#define | USIM_CLA 0x00 |
#define | USIM_CMD_RUN_UMTS_ALG 0x00, 0x88, 0x00, 0x81, 0x22 |
#define | USIM_CMD_GET_RESPONSE 0x00, 0xc0, 0x00, 0x00 |
#define | USIM_FSP_TEMPL_TAG 0x62 |
#define | USIM_TLV_FILE_DESC 0x82 |
#define | USIM_TLV_FILE_ID 0x83 |
#define | USIM_TLV_DF_NAME 0x84 |
#define | USIM_TLV_PROPR_INFO 0xA5 |
#define | USIM_TLV_LIFE_CYCLE_STATUS 0x8A |
#define | USIM_TLV_FILE_SIZE 0x80 |
#define | USIM_TLV_TOTAL_FILE_SIZE 0x81 |
#define | USIM_TLV_PIN_STATUS_TEMPLATE 0xC6 |
#define | USIM_TLV_SHORT_FILE_ID 0x88 |
#define | USIM_PS_DO_TAG 0x90 |
#define | AKA_RAND_LEN 16 |
#define | AKA_AUTN_LEN 16 |
#define | AKA_AUTS_LEN 14 |
#define | RES_MAX_LEN 16 |
#define | IK_LEN 16 |
#define | CK_LEN 16 |
Enumerations | |
enum | sim_types { SCARD_GSM_SIM, SCARD_USIM } |
Functions | |
scard_data * | scard_init (scard_sim_type sim_type) |
Initialize SIM/USIM connection using PC/SC. | |
int | scard_set_pin (struct scard_data *scard, const char *pin) |
Set PIN (CHV1/PIN1) code for accessing SIM/USIM commands. | |
void | scard_deinit (struct scard_data *scard) |
Deinitialize SIM/USIM connection. | |
int | scard_get_imsi (struct scard_data *scard, char *imsi, size_t *len) |
Read IMSI from SIM/USIM card. | |
int | scard_gsm_auth (struct scard_data *scard, const unsigned char *rand, unsigned char *sres, unsigned char *kc) |
Run GSM authentication command on SIM card. | |
int | scard_umts_auth (struct scard_data *scard, const unsigned char *rand, const unsigned char *autn, unsigned char *res, size_t *res_len, unsigned char *ik, unsigned char *ck, unsigned char *auts) |
Run UMTS authentication command on USIM card. |
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
This file implements wrapper functions for accessing GSM SIM and 3GPP USIM cards through PC/SC smartcard library. These functions are used to implement authentication routines for EAP-SIM and EAP-AKA.
Definition in file pcsc_funcs.c.
|
Deinitialize SIM/USIM connection.
Definition at line 364 of file pcsc_funcs.c. Here is the call graph for this function: |
|
Read IMSI from SIM/USIM card.
Definition at line 590 of file pcsc_funcs.c. Here is the call graph for this function: |
|
Run GSM authentication command on SIM card.
Definition at line 671 of file pcsc_funcs.c. Here is the call graph for this function: |
|
Initialize SIM/USIM connection using PC/SC.
Definition at line 203 of file pcsc_funcs.c. Here is the call graph for this function: |
|
Set PIN (CHV1/PIN1) code for accessing SIM/USIM commands.
Definition at line 334 of file pcsc_funcs.c. Here is the call graph for this function: |
|
Run UMTS authentication command on USIM card.
Definition at line 770 of file pcsc_funcs.c. Here is the call graph for this function: |