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); exit(1);
} }
/* initialize OpenPACE */
EAC_init();
/* Now we try to change the PIN. Therefor we need to establish a SM channel /* Now we try to change the PIN. Therefor we need to establish a SM channel
* with PACE. * with PACE.
@@ -128,6 +131,7 @@ err:
sc_reset(card, 1); sc_reset(card, 1);
sc_disconnect_card(card); sc_disconnect_card(card);
sc_release_context(ctx); sc_release_context(ctx);
EAC_cleanup();
return -r; return -r;
} }

View File

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