comparison simtool/grcard2.c @ 157:239ebdb8f2af

fc-simtool: grcard2-set-super command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 07 Feb 2021 02:47:51 +0000
parents 6d9d0cfc9ed8
children
comparison
equal deleted inserted replaced
156:6d9d0cfc9ed8 157:239ebdb8f2af
111 fprintf(stderr, "bad SW response: %04X\n", sim_resp_sw); 111 fprintf(stderr, "bad SW response: %04X\n", sim_resp_sw);
112 return(-1); 112 return(-1);
113 } 113 }
114 return(0); 114 return(0);
115 } 115 }
116
117 cmd_grcard2_set_super(argc, argv)
118 char **argv;
119 {
120 u_char cmd[13];
121 int rc;
122
123 /* Grcard2 proprietary command APDU */
124 cmd[0] = 0xA0;
125 cmd[1] = 0xD4;
126 cmd[2] = 0x3A;
127 cmd[3] = 0x0B;
128 cmd[4] = 8;
129 rc = encode_pin_entry(argv[1], cmd + 5);
130 if (rc < 0)
131 return(rc);
132 rc = apdu_exchange(cmd, 13);
133 if (rc < 0)
134 return(rc);
135 if (sim_resp_sw != 0x9000) {
136 fprintf(stderr, "bad SW response: %04X\n", sim_resp_sw);
137 return(-1);
138 }
139 return(0);
140 }