Yubico Forum
https://forum.yubico.com/

[QUESTION] pcsc: CreateChannelByNameOrChannel() failed
https://forum.yubico.com/viewtopic.php?f=35&t=2643
Page 1 of 1

Author:  fphammerle [ Fri Jun 02, 2017 12:15 pm ]
Post subject:  [QUESTION] pcsc: CreateChannelByNameOrChannel() failed

Hi,

I have been using my Yubikey 4 with gnupg for months without any issues.

My problem today:
Quote:
$ gpg --card-status
gpg: selecting openpgp failed: No such device
gpg: OpenPGP card not available: No such device
[1] 19672 exit 2 gpg --card-status


What I tried so far:
  • re-plug Yubikey (multiple usb ports)
  • restart scdaemon
  • restart pcscd

pcscd reports:
Quote:
sudo systemctl status pcscd
● pcscd.service - PC/SC Smart Card Daemon
Loaded: loaded (/lib/systemd/system/pcscd.service; indirect; vendor preset: enabled)
Active: inactive (dead) since Fri 2017-06-02 13:07:17 CEST; 2min 50s ago
Process: 18739 ExecStart=/usr/sbin/pcscd --foreground --auto-exit (code=exited, status=0/SUCCESS)
Main PID: 18739 (code=exited, status=0/SUCCESS)

Jun 02 13:01:05 host systemd[1]: Started PC/SC Smart Card Daemon.
Jun 02 13:01:12 host pcscd[18739]: 00000000 ifdhandler.c:144:CreateChannelByNameOrChannel() failed
Jun 02 13:01:12 host pcscd[18739]: 00000020 readerfactory.c:1043:RFInitializeReader() Open Port 0x2
Jun 02 13:01:12 host pcscd[18739]: 00000002 readerfactory.c:335:RFAddReader() Yubico Yubikey 4 OTP+
Jun 02 13:01:12 host pcscd[18739]: 00008803 ifdhandler.c:144:CreateChannelByNameOrChannel() failed
Jun 02 13:01:12 host pcscd[18739]: 00000010 readerfactory.c:1043:RFInitializeReader() Open Port 0x2
Jun 02 13:01:12 host pcscd[18739]: 00000002 readerfactory.c:335:RFAddReader() Yubico Yubikey 4 OTP+


Any ideas what might cause the CreateChannelByNameOrChannel() failed error?

Quote:
$ uname --kernel-name --kernel-release
Linux 4.4.0-53-generic
$ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 18.1 Serena
Release: 18.1
Codename: serena
$ gpg --version
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: [...]
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
$ pcscd --version
pcsc-lite version 1.8.14.
Copyright (C) 1999-2002 by David Corcoran <corcoran@musclecard.com>.
Copyright (C) 2001-2011 by Ludovic Rousseau <ludovic.rousseau@free.fr>.
Copyright (C) 2003-2004 by Damien Sauveron <sauveron@labri.fr>.
Report bugs to <muscle@lists.musclecard.com>.
Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d

Author:  fphammerle [ Fri Jun 02, 2017 1:45 pm ]
Post subject:  Re: [QUESTION] pcsc: CreateChannelByNameOrChannel() failed

Quote:
$ pcsc_scan
PC/SC device scanner
V 1.4.25 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.14
Using reader plug'n play mechanism
Scanning present readers...
0: Yubico Yubikey 4 OTP+U2F+CCID 00 00

Fri Jun 2 14:43:46 2017
Reader 0: Yubico Yubikey 4 OTP+U2F+CCID 00 00
Card state: Card inserted, Shared Mode,
ATR: 3B F8 13 00 00 81 31 FE 15 59 75 62 69 6B 65 79 34 D4

ATR: 3B F8 13 00 00 81 31 FE 15 59 75 62 69 6B 65 79 34 D4
+ TS = 3B --> Direct Convention
+ T0 = F8, Y(1): 1111, K: 8 (historical bytes)
TA(1) = 13 --> Fi=372, Di=4, 93 cycles/ETU
43010 bits/s at 4 MHz, fMax for Fi = 5 MHz => 53763 bits/s
TB(1) = 00 --> VPP is not electrically connected
TC(1) = 00 --> Extra guard time: 0
TD(1) = 81 --> Y(i+1) = 1000, Protocol T = 1
-----
TD(2) = 31 --> Y(i+1) = 0011, Protocol T = 1
-----
TA(3) = FE --> IFSC: 254
TB(3) = 15 --> Block Waiting Integer: 1 - Character Waiting Integer: 5
+ Historical bytes: 59 75 62 69 6B 65 79 34
Category indicator byte: 59 (proprietary format)
+ TCK = D4 (correct checksum)

Possibly identified card (using $HOME/.cache/smartcard_list.txt):
3B F8 13 00 00 81 31 FE 15 59 75 62 69 6B 65 79 34 D4
Yubico Yubikey 4 OTP+CCID

Author:  smckown [ Wed Sep 13, 2017 3:39 pm ]
Post subject:  Re: [QUESTION] pcsc: CreateChannelByNameOrChannel() failed

I had the same problem a day after installing opensc (and so pcscd) for doing some PIV applet testing with my Yubikey NEO.

The quick and dirty solution appears to be 'apt-get remove pcscd'. GnuPG operation behavior was restored.

Ubuntu 16.04

kernel: 4.10.0-33-generic
gnupg: 1.4.20-1ubuntu3.1
gnupg2: 2.1.11-6ubuntu2
scdaemon: 2.1.11-6ubuntu2
pcscd: 1.8.14-1ubuntu1.16.04.1 (uninstalled)
libccid: 1.4.22-1ubuntu0.1
opensc: 0.15.0-1ubuntu1 (uninstalled)
opensc-pkcs11: 0.15.0-1ubuntu1

Author:  fphammerle [ Wed Sep 13, 2017 6:23 pm ]
Post subject:  Re: [QUESTION] pcsc: CreateChannelByNameOrChannel() failed

smckown wrote:
The quick and dirty solution appears to be 'apt-get remove pcscd'. GnuPG operation behavior was restored.


Thanks!

For some reason the error described above does not occur any longer.
Unfortunately, I don't know what solved my problem.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/