On Wed, Nov 20, 2019 at 10:20:42PM +0000, Stuart Henderson wrote:
> 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/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
>
Service not running?
>From the pyscard source[0], looks like there's a distinct error for
instances of the card being removed and re-inserted while the service
is running: "Service was stopped"
It doesn't seem to be tripped anyway (at least, nothing bad
happened on my laptop), but wanted to throw it out there for awareness
"Service not running/available" and "Service was stopped" seems a bit
ambiguous in the first place.
[0]
https://github.com/LudovicRousseau/pyscard/blob/master/smartcard/scard/winscarddll.c#L411