annotate pcsc/atrmain.c @ 93:6041c601304d

fcsim1-mkprov: revert OTA key addition It appears that GrcardSIM2 cards (which is what we got for FCSIM1) do not support OTA after all, contrary to what we were previously led to believe by some tech support emails from Grcard - apparently those support emails and OTA descriptions referred to some other card model(s).
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 21 Apr 2021 05:38:39 +0000
parents 11f4f8a8fa33
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include <stdio.h>
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include <stdlib.h>
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 #include <pcsclite.h>
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 #include <winscard.h>
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 extern SCARDCONTEXT hContext;
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 extern SCARDHANDLE hCard;
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 extern char *selected_reader;
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 main(argc, argv)
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 char **argv;
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 {
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 parse_reader_select_opt(argc, argv);
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 setup_pcsc_context();
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 get_reader_list();
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 select_reader_by_num();
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 printf("Card reader name: %s\n", selected_reader);
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 connect_to_card();
2
11f4f8a8fa33 pcsc: ATR code refactoring
Mychaela Falconia <falcon@freecalypso.org>
parents: 1
diff changeset
19 retrieve_atr("ATR:");
1
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 SCardDisconnect(hCard, SCARD_UNPOWER_CARD);
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 SCardReleaseContext(hContext);
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 exit(0);
f7a03e53bb2c fc-pcsc-atr ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 }