On 2019/11/20 15:59, Lucas Raab wrote:
> Incorporated changes and includes the man page from the repo. The man
> page isn't really any different from the -h option though...

I think the manpage is useful, thanks.

I think this is nearly ready to commit, the only thing I see now is that
the behaviour when pcscd isn't running is a bit unfriendly, so I think
we should at least find somewhere to tell the user to run it first
(a mini README file possibly), but better still might be if we can
patch to improve the message:

$ ykman list
Traceback (most recent call last):
  File "/usr/local/bin/ykman", line 11, in <module>
    load_entry_point('yubikey-manager==3.1.0', 'console_scripts', 'ykman')()
  File "/usr/local/lib/python3.7/site-packages/ykman/cli/__main__.py", line 
260, in main
    cli(obj={})
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 722, in 
__call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in 
invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 895, in 
invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 535, in 
invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 17, 
in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/ykman/cli/__main__.py", line 
224, in list_keys
    for dev in list_devices():
  File "/usr/local/lib/python3.7/site-packages/ykman/descriptor.py", line 163, 
in list_devices
    for d in _list_drivers(transports):
  File "/usr/local/lib/python3.7/site-packages/ykman/descriptor.py", line 149, 
in _list_drivers
    for dev in open_ccid():
  File "/usr/local/lib/python3.7/site-packages/ykman/driver_ccid.py", line 326, 
in open_devices
    readers = list_readers()
  File "/usr/local/lib/python3.7/site-packages/ykman/driver_ccid.py", line 316, 
in list_readers
    return System.readers()
  File "/usr/local/lib/python3.7/site-packages/smartcard/System.py", line 42, 
in readers
    return smartcard.reader.ReaderFactory.ReaderFactory.readers(groups)
  File 
"/usr/local/lib/python3.7/site-packages/smartcard/reader/ReaderFactory.py", 
line 58, in readers
    zreaders += fm(groups)
  File "/usr/local/lib/python3.7/site-packages/smartcard/pcsc/PCSCReader.py", 
line 110, in readers
    hcontext = PCSCContext().getContext()
  File "/usr/local/lib/python3.7/site-packages/smartcard/pcsc/PCSCContext.py", 
line 56, in __init__
    self.renewContext()
  File "/usr/local/lib/python3.7/site-packages/smartcard/pcsc/PCSCContext.py", 
line 70, in renewContext
    PCSCContext.instance = PCSCContext.__PCSCContextSingleton()
  File "/usr/local/lib/python3.7/site-packages/smartcard/pcsc/PCSCContext.py", 
line 40, in __init__
    raise EstablishContextException(hresult)
smartcard.pcsc.PCSCExceptions.EstablishContextException: 'Failure to establish 
context: Service not available.'

$ doas rcctl start pcscd
pcscd(ok)

$ ykman list
YubiKey Standard [OTP]

$ ykman info
Device type: YubiKey Standard
Serial number: Not set or unreadable
Firmware version: 2.1.2
Enabled USB interfaces: OTP

Applications
OTP             Enabled      
FIDO U2F        Not available
OpenPGP         Not available
PIV             Not available
OATH            Not available
FIDO2           Not available

Reply via email to