Rename PC/SC library into PC/SC provider.
Sync symbols between configuration and source. Put default provider in opensc.conf, opensc-tool. git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3455 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
65a427e419
commit
0e2c664d34
15
configure.ac
15
configure.ac
|
@ -484,17 +484,19 @@ if test "${enable_pcsc}" = "yes"; then
|
|||
if test "${with_pcsc_provider}" = "detect"; then
|
||||
case "${host}" in
|
||||
*-*-darwin*)
|
||||
with_pcsc_provider="${full_usrlibdir}/libpcsclite.so"
|
||||
DEFAULT_PCSC_PROVIDER="${full_usrlibdir}/libpcsclite.so"
|
||||
;;
|
||||
*-mingw32*|*-winnt*|*-cygwin*)
|
||||
with_pcsc_provider="winscard.dll"
|
||||
DEFAULT_PCSC_PROVIDER="winscard.dll"
|
||||
;;
|
||||
*)
|
||||
with_pcsc_provider="${full_usrlibdir}/libpcsclite.so"
|
||||
DEFAULT_PCSC_PROVIDER="${full_usrlibdir}/libpcsclite.so"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
DEFAULT_PCSC_PROVIDER="${with_pcsc_provider}"
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([PCSC_DEFAULT_LIBRARY_NAME], ["${with_pcsc_provider}"], [Default PC/SC library])
|
||||
AC_DEFINE_UNQUOTED([DEFAULT_PCSC_PROVIDER], ["${DEFAULT_PCSC_PROVIDER}"], [Default PC/SC provider])
|
||||
fi
|
||||
|
||||
dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION,
|
||||
|
@ -533,7 +535,7 @@ if test "${enable_openct}" = "yes"; then
|
|||
OPTIONAL_OPENCT_CFLAGS="${OPENCT_CFLAGS}"
|
||||
OPTIONAL_OPENCT_LIBS="${OPENCT_LIBS}"
|
||||
fi
|
||||
test "${enable_pcsc}" = "yes" && OPENSC_FEATURES="${OPENSC_FEATURES} pcsc"
|
||||
test "${enable_pcsc}" = "yes" && OPENSC_FEATURES="${OPENSC_FEATURES} pcsc(${DEFAULT_PCSC_PROVIDER})"
|
||||
test "${enable_nsplugin}" = "yes" && OPENSC_FEATURES="${OPENSC_FEATURES} nsplugin"
|
||||
|
||||
AC_DEFINE_UNQUOTED([OPENSC_ETC_PATH], ["${full_sysconfdir}"], [etc path for libopensc])
|
||||
|
@ -558,6 +560,7 @@ AC_SUBST([OPENSC_LT_REVISION])
|
|||
AC_SUBST([OPENSC_LT_AGE])
|
||||
AC_SUBST([OPENSC_LT_OLDEST])
|
||||
AC_SUBST([WIN_LIBPREFIX])
|
||||
AC_SUBST([DEFAULT_PCSC_PROVIDER])
|
||||
AC_SUBST([OPTIONAL_ZLIB_CFLAGS])
|
||||
AC_SUBST([OPTIONAL_ZLIB_LIBS])
|
||||
AC_SUBST([OPTIONAL_READLINE_CFLAGS])
|
||||
|
@ -637,7 +640,7 @@ PC/SC support: ${enable_pcsc}
|
|||
OpenCT support: ${enable_openct}
|
||||
NSPlugin support: ${enable_nsplugin}
|
||||
|
||||
PC/SC default provider: ${with_pcsc_provider}
|
||||
PC/SC default provider: ${DEFAULT_PCSC_PROVIDER}
|
||||
pinentry: ${with_pinentry}
|
||||
|
||||
Host: ${host}
|
||||
|
|
|
@ -7,7 +7,10 @@ dist_noinst_DATA = opensc.conf.in
|
|||
nodist_noinst_DATA = opensc.conf
|
||||
|
||||
.in:
|
||||
sed -e "s|@pkgdatadir[@]|$(pkgdatadir)|g" < $^ > $@
|
||||
sed \
|
||||
-e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
|
||||
-e 's|@DEFAULT_PCSC_PROVIDER[@]|$(DEFAULT_PCSC_PROVIDER)|g' \
|
||||
< $^ > $@
|
||||
|
||||
sysconf_DATA=#required in order to create dir
|
||||
install-exec-hook: install-sysconfDATA opensc.conf
|
||||
|
|
|
@ -88,9 +88,9 @@ app default {
|
|||
# Default: false
|
||||
# enable_pinpad = true;
|
||||
#
|
||||
# Use specific pcsc library.
|
||||
# Default: system
|
||||
# library_name = /usr/lib/libpcsclite.so
|
||||
# Use specific pcsc provider.
|
||||
# Default: @DEFAULT_PCSC_PROVIDER@
|
||||
# provider_library = @DEFAULT_PCSC_PROVIDER@
|
||||
}
|
||||
|
||||
# options for openct support
|
||||
|
|
|
@ -67,7 +67,7 @@ struct pcsc_global_private_data {
|
|||
int connect_exclusive;
|
||||
int connect_reset;
|
||||
int transaction_reset;
|
||||
const char *library_name;
|
||||
const char *provider_library;
|
||||
lt_dlhandle dlhandle;
|
||||
SCardEstablishContext_t SCardEstablishContext;
|
||||
SCardReleaseContext_t SCardReleaseContext;
|
||||
|
@ -752,7 +752,7 @@ static int pcsc_init(sc_context_t *ctx, void **reader_data)
|
|||
gpriv->connect_exclusive = 0;
|
||||
gpriv->transaction_reset = 0;
|
||||
gpriv->enable_pinpad = 0;
|
||||
gpriv->library_name = PCSC_DEFAULT_LIBRARY_NAME;
|
||||
gpriv->provider_library = DEFAULT_PCSC_PROVIDER;
|
||||
|
||||
conf_block = sc_get_conf_block(ctx, "reader_driver", "pcsc", 1);
|
||||
if (conf_block) {
|
||||
|
@ -764,11 +764,11 @@ static int pcsc_init(sc_context_t *ctx, void **reader_data)
|
|||
scconf_get_bool(conf_block, "transaction_reset", gpriv->transaction_reset);
|
||||
gpriv->enable_pinpad =
|
||||
scconf_get_bool(conf_block, "enable_pinpad", gpriv->enable_pinpad);
|
||||
gpriv->library_name =
|
||||
scconf_get_str(conf_block, "library_name", gpriv->library_name);
|
||||
gpriv->provider_library =
|
||||
scconf_get_str(conf_block, "provider_library", gpriv->provider_library);
|
||||
}
|
||||
|
||||
gpriv->dlhandle = lt_dlopen(gpriv->library_name);
|
||||
gpriv->dlhandle = lt_dlopen(gpriv->provider_library);
|
||||
if (gpriv->dlhandle == NULL) {
|
||||
ret = SC_ERROR_CANNOT_LOAD_MODULE;
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue