[Gpg4win-devel] GnuPG with internal CCID driver

Jiri Kerestes jiri.kerestes at trustica.cz
Wed Jul 25 15:38:29 CEST 2018


On 25.7.2018 12:26, Werner Koch wrote:

> I cc Gniibe because he is the maintainer of scdaemon and does all card
> stuff these days.  Even that you write about Windows, this is not
> specific for Gpg4win because Gpg4win uses the standard GnuPG build for
> Windows under the hood.  So gnupg-devel would be more appropriate - but
> this list is also okay as long as we keep Gniibe in the loop.

cc'ing gnupg-devel ML.

>> I've done some hackery and I have a working w32 GnuPG build with libusb
>> support. I'm not very familiar with Gpg4win development history, so
>> before I dive into autotools to do this properly: is there any reason
>> why Gpg4Win shouldn't be shipped with libusb and internal CCID driver?
> Can you give some more background on this libusb?  I would be interested
> to support it also on Windows.

I just modified configure.ac to use precompiled libusb libraries from
SourceForge and included libusb-1.0.dll in
build-aux/speedo/w32/inst.nsi. I've included example diff below, but it
needs to be done properly (e.g. without hardcoded paths).

Windows system setup is described on libusb GitHub wiki [1]. If the USB
reader supports WCID [2], then it should work out-of-the-box. I tested
this on Windows 10 64-bit with our token. It works either with WinUSB
driver installed by Zadig tool, or with automatic WCID WinUSB driver


[2]: https://github.com/pbatard/libwdi/wiki/WCID-Devices

diff --git a/build-aux/speedo/w32/inst.nsi b/build-aux/speedo/w32/inst.nsi
--- a/build-aux/speedo/w32/inst.nsi
+++ b/build-aux/speedo/w32/inst.nsi
@@ -628,6 +628,7 @@ Section "GnuPG" SEC_gnupg
   File "libexec/dirmngr_ldap.exe"
   File "libexec/gpg-preset-passphrase.exe"
   File "libexec/gpg-wks-client.exe"
+  File "/home/nephirus/MinGW32/dll/libusb-1.0.dll"

   SetOverwrite try

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -806,7 +806,7 @@
 if test "$use_ccid_driver" = auto || test "$use_ccid_driver" = yes; then
    case "${host}" in
-       LIBUSB_NAME=
+       LIBUSB_NAME=usb-1.0.dll
@@ -826,6 +826,8 @@ if test "$use_ccid_driver" = auto || test
"$use_ccid_driver" = yes; then
 if test x"$LIBUSB_NAME" != x ; then
+   CPPFLAGS="${CPPFLAGS} -I/home/nephirus/include/libusb-1.0"
+   LDFLAGS="${LDFLAGS} -L/home/nephirus/MinGW32/dll"
    AC_CHECK_LIB($LIBUSB_NAME, libusb_init,
                 [ LIBUSB_LIBS="-l$LIBUSB_NAME $LIBUSB_LIBS"
                   have_libusb=yes ])

Best regards


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20180725/f49df4a4/attachment-0001.sig>

More information about the Gnupg-devel mailing list