comparison uicc/select.c @ 139:6c6e8705dc70

fc-uicc-tool: select-usim and select-isim implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 04 Feb 2021 05:00:12 +0000
parents baf5bd698764
children 429a8f80426e
comparison
equal deleted inserted replaced
138:baf5bd698764 139:6c6e8705dc70
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <pcsclite.h> 7 #include <pcsclite.h>
8 #include <winscard.h> 8 #include <winscard.h>
9 #include "globals.h" 9 #include "globals.h"
10
11 u_char std_aid_usim[7] = {0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x02};
12 u_char std_aid_isim[7] = {0xA0, 0x00, 0x00, 0x00, 0x87, 0x10, 0x04};
10 13
11 select_op(file_id) 14 select_op(file_id)
12 unsigned file_id; 15 unsigned file_id;
13 { 16 {
14 u_char cmd[7]; 17 u_char cmd[7];
215 if (rc < 0) 218 if (rc < 0)
216 return(rc); 219 return(rc);
217 return parse_and_display_select_response(); 220 return parse_and_display_select_response();
218 } 221 }
219 222
223 cmd_select_usim()
224 {
225 int rc;
226
227 rc = select_aid_op(std_aid_usim, 7);
228 if (rc < 0)
229 return(rc);
230 return parse_and_display_select_response();
231 }
232
233 cmd_select_isim()
234 {
235 int rc;
236
237 rc = select_aid_op(std_aid_isim, 7);
238 if (rc < 0)
239 return(rc);
240 return parse_and_display_select_response();
241 }
242
220 u_char * 243 u_char *
221 extract_select_resp_tag(sought_tag) 244 extract_select_resp_tag(sought_tag)
222 unsigned sought_tag; 245 unsigned sought_tag;
223 { 246 {
224 unsigned offset, totlen, reclen; 247 unsigned offset, totlen, reclen;