Page MenuHome GnuPG

gnupg 2.1.12 doesn't properly detect libusb in FreeBSD
Closed, ResolvedPublic

Description

When compiling gnupg 2.1.12 (which uses the libusb 1.0 API), the configure
scripts do not properly detect the standard FreeBSD 10.x libusb as being
compatible with the libusb 1.0 API. As a result, the built-in CCID driver gets
disabled, and CCID-compatible smartcards (including my Yubikey NEO) do not work
with scdaemon. If I attempt to force-enable the CCID driver by including
--enable-ccid-driver on the command line, the configure script dies with the
warning:

configure:


  • You need libusb to build the internal ccid driver. Please
  • install a libusb suitable for your system.

configure: error:


  • Required libraries not found. Please consult the above messages
  • and install them before running configure again.

However, it is not necessary to install an external libusb. As the attached
config.log shows, the configure script is looking for libusb-1.0 rather than
libusb. If I create a symlink from libusb-1.0.so to libusb.so and run ldconfig
-R, the package will compile properly with a working CCID driver, and my Yubikey
will work properly in OpenPGP mode.

It appears that a patch simply needs to be applied to the configure scripts. I
don't know if this affects the other *BSDs, but the problem (and workaround) can
be replicated on both FreeBSD 10-STABLE, and 11-CURRENT.

Details

Version
2.1.12

Related Objects

Event Timeline

msinatra renamed this task from gnuph 2.1.12 doesn't properly detect libusb in FreeBSD to gnupg 2.1.12 doesn't properly detect libusb in FreeBSD.May 24 2016, 11:25 PM

Thank you for the report.
Indeed, the configure script has a bug.
Attached is a patch to fix this.

Looks good...I can even build and run it using the ports version if I hand-patch
it after extracting:

[sonicyouth] /usr/ports/security/gnupg# make extract

> License GPLv3 LGPL3 accepted by the user

> Found saved configuration for gnupg-2.1.12

> gnupg-2.1.12 depends on file: /usr/local/sbin/pkg - found

> Fetching all distfiles required by gnupg-2.1.12 for building

> Extracting for gnupg-2.1.12

> SHA256 Checksum OK for gnupg-2.1.12.tar.bz2.

> SHA256 Checksum OK for gnupg-2.1.12.tar.bz2.sig.

[sonicyouth] /usr/ports/security/gnupg# cd work/gnupg-2.1.12/
[sonicyouth] /usr/ports/security/gnupg/work/gnupg-2.1.12# patch <
~ms/Downloads/gnupg-master-
20160527.diff
Hmm... Looks like a unified diff to me...

The text leading up to this was:

diff --git a/configure.ac b/configure.ac
index 6458f1a..d90921c 100644
--- a/configure.ac
+++ b/configure.ac

Patching file configure.ac using Plan A...
Hunk #1 succeeded at 787.
done
[sonicyouth] /usr/ports/security/gnupg/work/gnupg-2.1.12# autoconf
[sonicyouth] /usr/ports/security/gnupg/work/gnupg-2.1.12# cd ../../
[sonicyouth] /usr/ports/security/gnupg# make install
[snip]

gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
Reader ...........: 1050:0111:X:0
Application ID ...: D2760001240102000006036429670000
Version ..........: 2.0
Manufacturer .....: Yubico
[snip]

gniibe removed a project: Restricted Project.Jun 23 2016, 9:27 AM