Bug 1715480

Summary: [abrt] yubikey-manager: doTransmit(): driver_ccid.py:228:send_apdu:ykman.driver_ccid.CCIDError: Failed to transmit with protocol T1. Invalid value given.
Product: [Fedora] Fedora Reporter: Paul Nickerson <pgn674>
Component: yubikey-managerAssignee: Gerald Cox <gbcox>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: gbcox, pnickerson, sethdjennings
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/ec76d3e06450e1926fb3191c9d9ae9b2c821229e
Whiteboard: abrt_hash:8bb5717e58220ef834d7de6aa2c4f1e3afa81806;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-04 13:28:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Paul Nickerson 2019-05-30 13:06:11 UTC
Description of problem:
I was getting the below in journalctl repeatedly while my YubiKey was plugged in. I unplugged it, and then plugged it back in, and got this crash.

May 30 09:01:00 pnickerson-fedora-t460 pcscd[1940]: 01003354 commands.c:1564:CCID_Receive Overrun error
May 30 09:01:00 pnickerson-fedora-t460 pcscd[1940]: 00000044 ifdwrapper.c:543:IFDTransmit() Card not transacted: 612
May 30 09:01:00 pnickerson-fedora-t460 pcscd[1940]: 00000023 winscard.c:1620:SCardTransmit() Card not transacted: 0x80100016

Version-Release number of selected component:
yubikey-manager-2.1.0-2.gitb44d719.fc30

Additional info:
reporter:       libreport-2.10.0
cmdline:        /usr/bin/python3 /usr/bin/ykman oath code
crash_function: doTransmit
exception_type: smartcard.Exceptions.CardConnectionException
executable:     /usr/bin/ykman
interpreter:    python3-3.7.3-3.fc30.x86_64
kernel:         5.0.17-300.fc30.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
driver_ccid.py:228:send_apdu:ykman.driver_ccid.CCIDError: Failed to transmit with protocol T1. Invalid value given.

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/ykman/driver_ccid.py", line 225, in send_apdu
    resp, sw1, sw2 = self._conn.transmit(header + body)
  File "/usr/lib64/python3.7/site-packages/smartcard/CardConnectionDecorator.py", line 82, in transmit
    return self.component.transmit(bytes, protocol)
  File "/usr/lib64/python3.7/site-packages/smartcard/CardConnection.py", line 146, in transmit
    data, sw1, sw2 = self.doTransmit(bytes, protocol)
  File "/usr/lib64/python3.7/site-packages/smartcard/pcsc/PCSCCardConnection.py", line 205, in doTransmit
    SCardGetErrorMessage(hresult))
smartcard.Exceptions.CardConnectionException: Failed to transmit with protocol T1. Invalid value given.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/ykman", line 11, in <module>
    load_entry_point('yubikey-manager==2.1.0', 'console_scripts', 'ykman')()
  File "/usr/lib/python3.7/site-packages/ykman/cli/__main__.py", line 253, in main
    cli(obj={})
  File "/usr/lib/python3.7/site-packages/click/core.py", line 763, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 716, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1136, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1136, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 955, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 554, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/ykman/cli/oath.py", line 344, in code
    ensure_validated(ctx)
  File "/usr/lib/python3.7/site-packages/ykman/cli/oath.py", line 500, in ensure_validated
    controller = ctx.obj['controller']
  File "/usr/lib/python3.7/site-packages/ykman/cli/util.py", line 106, in __getitem__
    self.resolve()
  File "/usr/lib/python3.7/site-packages/ykman/cli/util.py", line 103, in resolve
    self._objects[k] = f()
  File "/usr/lib/python3.7/site-packages/ykman/cli/__main__.py", line 188, in resolve_device
    dev = _run_cmd_for_single(ctx, subcmd.name, transports, reader)
  File "/usr/lib/python3.7/site-packages/ykman/cli/__main__.py", line 128, in _run_cmd_for_single
    return descriptor.open_device(transports)
  File "/usr/lib/python3.7/site-packages/ykman/descriptor.py", line 87, in open_device
    dev = YubiKey(self, drv)
  File "/usr/lib/python3.7/site-packages/ykman/device.py", line 199, in __init__
    config = DeviceConfig(driver.read_config())
  File "/usr/lib/python3.7/site-packages/ykman/driver_ccid.py", line 198, in read_config
    self.select(AID.MGR)
  File "/usr/lib/python3.7/site-packages/ykman/driver_ccid.py", line 239, in select
    return self.send_apdu(0, GP_INS_SELECT, 0x04, 0, aid)
  File "/usr/lib/python3.7/site-packages/ykman/driver_ccid.py", line 228, in send_apdu
    raise CCIDError(e)
ykman.driver_ccid.CCIDError: Failed to transmit with protocol T1. Invalid value given.

Local variables in innermost frame:
self: <ykman.driver_ccid.CCIDDriver object at 0x7fc45aba2ac8>
cl: 0
ins: 164
p1: 4
p2: 0
data: <AID.MGR: b"\xa0\x00\x00\x05'G\x11\x17">
check: <SW.OK: 36864>
header: [0, 164, 4, 0, 8]
body: [160, 0, 0, 5, 39, 71, 17, 23]

Comment 1 Paul Nickerson 2019-05-30 13:06:15 UTC
Created attachment 1575216 [details]
File: backtrace

Comment 2 Paul Nickerson 2019-05-30 13:06:16 UTC
Created attachment 1575217 [details]
File: cgroup

Comment 3 Paul Nickerson 2019-05-30 13:06:17 UTC
Created attachment 1575218 [details]
File: cpuinfo

Comment 4 Paul Nickerson 2019-05-30 13:06:19 UTC
Created attachment 1575219 [details]
File: environ

Comment 5 Paul Nickerson 2019-05-30 13:06:20 UTC
Created attachment 1575220 [details]
File: mountinfo

Comment 6 Paul Nickerson 2019-05-30 13:06:21 UTC
Created attachment 1575221 [details]
File: namespaces

Comment 7 Paul Nickerson 2019-05-30 13:06:22 UTC
Created attachment 1575222 [details]
File: open_fds

Comment 8 Gerald Cox 2019-05-30 15:58:15 UTC
Please open a report upstream and update this record with the #.  You should also reference this report and include which yubikey you are using.  I'm currently running the Yubikey Neo and Yubikey 5 and not experiencing any issues.

Comment 9 Gerald Cox 2019-05-30 15:58:47 UTC
Upstream URL to report issues is:  https://github.com/Yubico/yubikey-manager/issues

Comment 10 Paul Nickerson 2019-07-12 14:28:43 UTC
Hi, sorry, I thought this crash was something that was happening repeatedly, but I was mistaken. I have not been able to reproduce it. I don't think I can help more with this bug report.

Comment 11 Paul Nickerson 2019-11-25 02:31:59 UTC
I'm getting emailed about the needinfo flag on this bug report, so I'm commenting here now so that I can remove the flag, as I can't provide info and the ticket is closed.