mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
(apdu_open_reader): Hacks for PC/SC under Windows.
This commit is contained in:
parent
068358616f
commit
624612b991
@ -1,3 +1,7 @@
|
|||||||
|
2003-10-24 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* apdu.c (apdu_open_reader): Hacks for PC/SC under Windows.
|
||||||
|
|
||||||
2003-10-21 Werner Koch <wk@gnupg.org>
|
2003-10-21 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* passphrase.c (ask_passphrase): Add optional promptid arg.
|
* passphrase.c (ask_passphrase): Add optional promptid arg.
|
||||||
|
32
g10/apdu.c
32
g10/apdu.c
@ -298,6 +298,7 @@ ct_activate_card (int reader)
|
|||||||
{
|
{
|
||||||
log_error ("ct_activate_card(%d): activation failed: %s\n",
|
log_error ("ct_activate_card(%d): activation failed: %s\n",
|
||||||
reader, ct_error_string (rc));
|
reader, ct_error_string (rc));
|
||||||
|
log_printhex ("buffer:", buf, buflen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -933,7 +934,7 @@ apdu_open_reader (const char *portstr)
|
|||||||
CT_close = dlsym (handle, "CT_close");
|
CT_close = dlsym (handle, "CT_close");
|
||||||
if (!CT_init || !CT_data || !CT_close)
|
if (!CT_init || !CT_data || !CT_close)
|
||||||
{
|
{
|
||||||
log_error ("apdu_open_reader: invalid ctAPI driver\n");
|
log_error ("apdu_open_reader: invalid CT-API driver\n");
|
||||||
dlclose (handle);
|
dlclose (handle);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -959,9 +960,21 @@ apdu_open_reader (const char *portstr)
|
|||||||
pcsc_establish_context = dlsym (handle, "SCardEstablishContext");
|
pcsc_establish_context = dlsym (handle, "SCardEstablishContext");
|
||||||
pcsc_release_context = dlsym (handle, "SCardReleaseContext");
|
pcsc_release_context = dlsym (handle, "SCardReleaseContext");
|
||||||
pcsc_list_readers = dlsym (handle, "SCardListReaders");
|
pcsc_list_readers = dlsym (handle, "SCardListReaders");
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (!pcsc_list_readers)
|
||||||
|
pcsc_list_readers = dlsym (handle, "SCardListReadersA");
|
||||||
|
#endif
|
||||||
pcsc_connect = dlsym (handle, "SCardConnect");
|
pcsc_connect = dlsym (handle, "SCardConnect");
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (!pcsc_connect)
|
||||||
|
pcsc_connect = dlsym (handle, "SCardConnectA");
|
||||||
|
#endif
|
||||||
pcsc_disconnect = dlsym (handle, "SCardDisconnect");
|
pcsc_disconnect = dlsym (handle, "SCardDisconnect");
|
||||||
pcsc_status = dlsym (handle, "SCardStatus");
|
pcsc_status = dlsym (handle, "SCardStatus");
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (pcsc_status)
|
||||||
|
pcsc_status = dlsym (handle, "SCardStatusA");
|
||||||
|
#endif
|
||||||
pcsc_begin_transaction = dlsym (handle, "SCardBeginTransaction");
|
pcsc_begin_transaction = dlsym (handle, "SCardBeginTransaction");
|
||||||
pcsc_end_transaction = dlsym (handle, "SCardEndTransaction");
|
pcsc_end_transaction = dlsym (handle, "SCardEndTransaction");
|
||||||
pcsc_transmit = dlsym (handle, "SCardTransmit");
|
pcsc_transmit = dlsym (handle, "SCardTransmit");
|
||||||
@ -976,9 +989,22 @@ apdu_open_reader (const char *portstr)
|
|||||||
|| !pcsc_begin_transaction
|
|| !pcsc_begin_transaction
|
||||||
|| !pcsc_end_transaction
|
|| !pcsc_end_transaction
|
||||||
|| !pcsc_transmit
|
|| !pcsc_transmit
|
||||||
|| !pcsc_set_timeout)
|
/* || !pcsc_set_timeout */)
|
||||||
{
|
{
|
||||||
log_error ("apdu_open_reader: invalid PC/SC driver\n");
|
/* Note that set_timeout is currently not used and also not
|
||||||
|
available under Windows. */
|
||||||
|
log_error ("apdu_open_reader: invalid PC/SC driver "
|
||||||
|
"(%d%d%d%d%d%d%d%d%d%d)\n",
|
||||||
|
!!pcsc_establish_context,
|
||||||
|
!!pcsc_release_context,
|
||||||
|
!!pcsc_list_readers,
|
||||||
|
!!pcsc_connect,
|
||||||
|
!!pcsc_disconnect,
|
||||||
|
!!pcsc_status,
|
||||||
|
!!pcsc_begin_transaction,
|
||||||
|
!!pcsc_end_transaction,
|
||||||
|
!!pcsc_transmit,
|
||||||
|
!!pcsc_set_timeout );
|
||||||
dlclose (handle);
|
dlclose (handle);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user