linking against opensc now as shared library
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@394 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -1,28 +1,15 @@
|
||||
OPENSCVERSION = 0.12.0
|
||||
EXTRA_DIST = opensc
|
||||
|
||||
EXTRA_DIST = opensc-$(OPENSCVERSION)
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src/pace -I$(top_srcdir)/src/opensc-$(OPENSCVERSION)/src
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src/pace -I$(top_srcdir)/src/opensc/src
|
||||
|
||||
libpace_la_SOURCES = sm.c scutil.c pace.c pace_lib.c
|
||||
libpace_la_LIBADD = $(OPENSSL_LIBS) libopensc.la
|
||||
libpace_la_LIBADD = $(OPENSSL_LIBS) $(OPENSC_LIBS)
|
||||
libpace_la_CFLAGS = $(OPENSSL_CFLAGS)
|
||||
|
||||
pace_tool_SOURCES = pace-tool.c binutil.c
|
||||
pace_tool_LDADD = $(OPENSSL_LIBS) libpace.la libopensc.la
|
||||
pace_tool_LDADD = $(OPENSSL_LIBS) $(OPENSC_LIBS) libpace.la
|
||||
pace_tool_CFLAGS = $(OPENSSL_CFLAGS)
|
||||
|
||||
opensc:
|
||||
cp -r $(top_srcdir)/src/opensc-$(OPENSCVERSION) opensc
|
||||
cd opensc && ./configure OPENSSL_LIBS="$(OPENSSL_LIBS)" OPENSSL_CFLAGS="$(OPENSSL_CFLAGS)" $(OPENSC_CONFIGURE)
|
||||
|
||||
.PHONY:libopensc.la
|
||||
libopensc.la: opensc
|
||||
$(MAKE) -C opensc
|
||||
cp opensc/src/libopensc/.libs/libopensc.* .
|
||||
|
||||
clean-local:
|
||||
rm -rf opensc libopensc.*
|
||||
|
||||
bin_PROGRAMS = pace-tool
|
||||
|
||||
|
||||
@@ -185,6 +185,7 @@ main (int argc, char **argv)
|
||||
struct establish_pace_channel_input pace_input;
|
||||
struct establish_pace_channel_output pace_output;
|
||||
time_t t_start, t_end;
|
||||
struct timeval tv;
|
||||
size_t outlen;
|
||||
|
||||
memset(&sctx, 0, sizeof sctx);
|
||||
@@ -367,23 +368,28 @@ main (int argc, char **argv)
|
||||
if (strlen(can_ch) > pace_input.pin_length)
|
||||
break;
|
||||
|
||||
printf("Trying %s=%s\n",
|
||||
gettimeofday(&tv, NULL);
|
||||
printf("%d,%06d: Trying %s=%s\n",
|
||||
tv.tv_sec, tv.tv_usec,
|
||||
pace_secret_name(pace_input.pin_id), pace_input.pin);
|
||||
i = EstablishPACEChannel(NULL, card, pace_input, &pace_output,
|
||||
&sctx);
|
||||
|
||||
can_nb++;
|
||||
} while (0 > i);
|
||||
can_nb--;
|
||||
} while (0 > i && can_nb > 0);
|
||||
t_end = time(NULL);
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
if (0 > i) {
|
||||
printf("Tried breaking %s for %.0fs without success.\n",
|
||||
printf("%d,%06d: Tried breaking %s for %.0fs without success.\n",
|
||||
tv.tv_sec, tv.tv_usec,
|
||||
pace_secret_name(pace_input.pin_id), difftime(t_end, t_start));
|
||||
goto err;
|
||||
} else {
|
||||
printf("Tried breaking %s for %.0fs with success.\n",
|
||||
pace_secret_name(pace_input.pin_id), difftime(t_end, t_start));
|
||||
printf("%s=%s\n", pace_secret_name(pace_input.pin_id), pace_input.pin);
|
||||
printf("%d,%06d: Tried breaking %s for %.0fs with success (%s=%s).\n",
|
||||
tv.tv_sec, tv.tv_usec,
|
||||
pace_secret_name(pace_input.pin_id), difftime(t_end, t_start),
|
||||
pace_secret_name(pace_input.pin_id), pace_input.pin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user