pcsc_funcs.h

Go to the documentation of this file.
00001 
00016 #ifndef PCSC_FUNCS_H
00017 #define PCSC_FUNCS_H
00018 
00019 /* GSM files
00020  * File type in first octet:
00021  * 3F = Master File
00022  * 7F = Dedicated File
00023  * 2F = Elementary File under the Master File
00024  * 6F = Elementary File under a Dedicated File
00025  */
00026 #define SCARD_FILE_MF           0x3F00
00027 #define SCARD_FILE_GSM_DF       0x7F20
00028 #define SCARD_FILE_UMTS_DF      0x7F50
00029 #define SCARD_FILE_GSM_EF_IMSI  0x6F07
00030 #define SCARD_FILE_EF_ICCID     0x2FE2
00031 #define SCARD_FILE_EF_CK        0x6FE1
00032 #define SCARD_FILE_EF_IK        0x6FE2
00033 
00034 #define SCARD_CHV1_OFFSET       13
00035 #define SCARD_CHV1_FLAG         0x80
00036 
00037 typedef enum {
00038         SCARD_GSM_SIM_ONLY,
00039         SCARD_USIM_ONLY,
00040         SCARD_TRY_BOTH
00041 } scard_sim_type;
00042 
00043 
00044 #ifdef PCSC_FUNCS
00045 struct scard_data * scard_init(scard_sim_type sim_type);
00046 void scard_deinit(struct scard_data *scard);
00047 
00048 int scard_set_pin(struct scard_data *scard, const char *pin);
00049 int scard_get_imsi(struct scard_data *scard, char *imsi, size_t *len);
00050 int scard_gsm_auth(struct scard_data *scard, const unsigned char *rand,
00051                    unsigned char *sres, unsigned char *kc);
00052 int scard_umts_auth(struct scard_data *scard, const unsigned char *rand,
00053                     const unsigned char *autn,
00054                     unsigned char *res, size_t *res_len,
00055                     unsigned char *ik, unsigned char *ck, unsigned char *auts);
00056 
00057 #else /* PCSC_FUNCS */
00058 
00059 #define scard_init(s) NULL
00060 #define scard_deinit(s) do { } while (0)
00061 #define scard_set_pin(s, p) -1
00062 #define scard_get_imsi(s, i, l) -1
00063 #define scard_gsm_auth(s, r, s2, k) -1
00064 #define scard_umts_auth(s, r, a, r2, rl, i, c, a2) -1
00065 
00066 #endif /* PCSC_FUNCS */
00067 
00068 #endif /* PCSC_FUNCS_H */
00069 

Generated on Sat May 6 21:13:37 2006 for wpa_supplicant by  doxygen 1.4.2