From owner-freebsd-usb@freebsd.org Thu May 11 09:02:44 2017 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90FAED6875E for ; Thu, 11 May 2017 09:02:44 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57058124F for ; Thu, 11 May 2017 09:02:44 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [2.247.254.148] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1d8jzX-0002To-EE for freebsd-usb@freebsd.org; Thu, 11 May 2017 11:02:35 +0200 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.15.2/8.14.9) with ESMTPS id v4B92Vmn026459 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 May 2017 11:02:31 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.15.2/8.14.9/Submit) id v4B92U8a026458 for freebsd-usb@freebsd.org; Thu, 11 May 2017 11:02:30 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 11 May 2017 11:02:30 +0200 From: Matthias Apitz To: freebsd-usb@freebsd.org Subject: Re: GnuPG && card readers Message-ID: <20170511090230.GA26224@c720-r314251> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , freebsd-usb@freebsd.org References: <20170509094729.GA3668@c720-r314251> <20170509213637.Horde.u9PInhb6UaNmyy2nhXlnMGr@webmail.leidinger.net> <20170510073903.GA2836@c720-r314251> <20170511065844.GA25086@c720-r314251> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170511065844.GA25086@c720-r314251> X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) User-Agent: Mutt/1.8.0 (2017-02-23) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 2.247.254.148 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2017 09:02:44 -0000 El día jueves, mayo 11, 2017 a las 08:58:44a. m. +0200, Matthias Apitz escribió: > > El día martes, mayo 09, 2017 a las 09:36:37p. m. +0200, Alexander Leidinger escribió: > > > > > It's not FreeBSD which needs the support. gnupg comes with the > > > drivers, FreeBSD only needs to see "a device on the bus", that's enough. > > > > > > Check out the ports security/opensc amd devel/libccid (and gnupg needs > > > to be build with the SCDAEMON option of the port). This will bring in > > > the pcsc-lite port as a depedency. Those are the "drivers" for USB > > > card readers if you want to use them beyond what gnupg will do. > > > > > > ... > > I installed the mentioned ports and enabled the start in /etc/rc.conf with > > pcscd_enable="YES" > > but this would make hang the system on startup/boot: > > 25038 1 S+ 0:00,02 /bin/sh /usr/local/etc/rc.d/pcscd start > 25043 1 S+ 0:00,01 /usr/local/sbin/pcscd > 25044 1 S+ 0:00,01 /usr/local/sbin/pcscd > interestingly to note: I have the exact same system (12-CURRENT r314251 and with same ports from my own pkg repository out of poudriere) in a VBOX machine; when I start there the pcscd in foreground and with --debug it says: root@r314251-amd64:~ # /usr/local/sbin/pcscd --debug --foreground 00000000 pcscdaemon.c:346:main() pcscd set to foreground with debug send to stdout 00000516 configfile.l:358:DBGetReaderList() Parsing conf file: /usr/local/etc/reader.conf.d 00000043 pcscdaemon.c:655:main() pcsc-lite 1.8.20 daemon ready. 00010018 hotplug_libusb.c:440:HPEstablishUSBNotifications() Driver ifd-ccid.bundle does not support IFD_GENERATE_HOTPLUG. Using active polling instead. 00000124 hotplug_libusb.c:449:HPEstablishUSBNotifications() Polling forced every 1 second(s) and a truss on the PID shows that is is really polling once every second: ... openat(AT_FDCWD,"/dev/ugen1.1",O_RDWR,00) = 7 (0x7) openat(AT_FDCWD,"/dev/ugen1.1",O_RDWR,00) = 8 (0x8) ioctl(8,USB_GET_PLUGTIME,0xdfdfcddc) = 0 (0x0) ioctl(7,USB_GET_CONFIG,0xdfdfce44) = 0 (0x0) close(8) = 0 (0x0) close(7) = 0 (0x0) openat(AT_FDCWD,"/dev/ugen1.1",O_RDWR,00) = 7 (0x7) openat(AT_FDCWD,"/dev/ugen1.1",O_RDWR,00) = 8 (0x8) ... On the other system, an Acer C720 netbook, it says only: root@c720-r314251:~ # /usr/local/sbin/pcscd --debug --foreground 00000000 pcscdaemon.c:346:main() pcscd set to foreground with debug send to stdout 00000550 configfile.l:358:DBGetReaderList() Parsing conf file: /usr/local/etc/reader.conf.d 00000049 pcscdaemon.c:655:main() pcsc-lite 1.8.20 daemon ready. i.e. the line about hotplug_libusb.c:440:HPEstablishUSBNotifications() does not show up; and a truss shows that is is doing/waiting on something on a dev; it is very slow doing some ioctls: openat(AT_FDCWD,"/dev/usbctl",O_RDONLY,00) = 11 (0xb) ioctl(11,USB_READ_DIR,0xdfdfcb38) = 0 (0x0) openat(AT_FDCWD,"/dev/ugen1.1",O_RDWR,00) = 12 (0xc) ioctl(12,USB_GET_PLUGTIME,0xdfdfcb1c) = 0 (0x0) ioctl(12,USB_GET_DEVICE_DESC,0xdfdfcb20) = 0 (0x0) ioctl(12,USB_GET_DEVICEINFO,0xdfdfccb0) = 0 (0x0) -- Matthias Apitz, ✉ guru@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045