annotate misc/fc-pcsc-list.c @ 74:8562d8508cf2

grcard2-set-{adm,super}-hex commands implemented It appears that GrcardSIM2 cards allow arbitrary 64-bit keys for ADM and SUPER ADM, not necessarily consisting of ASCII digits like the specs require for standard PIN and PUK, and pySim-prog.py in fact sets the ADM key to 4444444444444444 in hex by default, which is not an ASCII digit string. If the cards allow such keys, we need to support them too.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 16 Feb 2021 04:10:36 +0000
parents be9984600bf8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include <string.h>
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include <strings.h>
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #include <stdio.h>
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 #include <stdlib.h>
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <pcsclite.h>
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <winscard.h>
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include "cardif.h"
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 main(argc, argv)
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 char **argv;
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 {
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 char *cp;
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 unsigned num;
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 setup_pcsc_context();
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 get_reader_list();
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 for (cp = reader_list, num = 0; *cp; num++) {
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 printf("#%u: %s\n", num, cp);
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 cp += strlen(cp) + 1;
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 }
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 SCardReleaseContext(hContext);
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 exit(0);
be9984600bf8 fc-pcsc-list utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 }