use EAC_init() and EAC_cleanup()

This commit is contained in:
Frank Morgner
2013-09-24 01:14:29 +02:00
parent db01d94484
commit 1998fddf69
2 changed files with 7 additions and 0 deletions

View File

@@ -71,6 +71,9 @@ main (int argc, char **argv)
exit(1);
}
/* initialize OpenPACE */
EAC_init();
/* Now we try to change the PIN. Therefor we need to establish a SM channel
* with PACE.
@@ -128,6 +131,7 @@ err:
sc_reset(card, 1);
sc_disconnect_card(card);
sc_release_context(ctx);
EAC_cleanup();
return -r;
}

View File

@@ -373,6 +373,8 @@ main (int argc, char **argv)
sc_initialize_boxing_cmds(ctx);
#endif
EAC_init();
if (cmdline.break_flag) {
/* The biggest buffer sprintf could write with "%llu" */
char secretbuf[strlen("18446744073709551615")+1];
@@ -808,6 +810,7 @@ err:
sc_reset(card, 1);
sc_disconnect_card(card);
sc_release_context(ctx);
EAC_cleanup();
if (r < 0)
fprintf(stderr, "Error: %s\n", sc_strerror(r));