From 1998fddf69fcd392c41444336e996f624921a5bb Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Tue, 24 Sep 2013 01:14:29 +0200 Subject: [PATCH] use EAC_init() and EAC_cleanup() --- npa/src/example.c | 4 ++++ npa/src/npa-tool.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/npa/src/example.c b/npa/src/example.c index 9d23506..7c7f266 100644 --- a/npa/src/example.c +++ b/npa/src/example.c @@ -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; } diff --git a/npa/src/npa-tool.c b/npa/src/npa-tool.c index e54e833..e79f125 100644 --- a/npa/src/npa-tool.c +++ b/npa/src/npa-tool.c @@ -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));