yubico-piv-tool
yubico-piv-tool copied to clipboard
Imporve ykpiv_connect failure user message
Provide a hint for user that PC/SC service may be down, as user should take a specific action to resolve the issue.
Signed-off-by: Alon Bar-Lev [email protected]
Thank you for the pull request!
We need to check how this works on different OS:es, I suspect the error code might differ.. As a first step, what have you tried this on ? Thx again.
Hi,
Tested on linux with pcsc-lite.
In windows scard service always available but it also well documented https://docs.microsoft.com/en-us/windows/win32/com/com-error-codes-4
I can add SCARD_E_SERVICE_STOPPED
to the same condition.
Hello @qpernil,
Can you please have another look?
All pcsc implementations have SCARD_E_NO_SERVICE
and also in the remotely chance that it is not available the previous functionality will be provided and return value will be YKPIV_PCSC_ERROR
as of now.
Thanks,
I have created https://github.com/Yubico/yubico-piv-tool/pull/407 that maps PCSC errors everywhere, and includes your proposed new error code, which is printed as well now. I skipped your changes to the pkcs11 module as they were only debug output which is generated anyway. Let me know if this would solve your issue.
Thanks! It seems ok. However, the missing bit is to understand what happens, you already have errors (not debug) for regular user to hint what's wrong, the error should be improved, I will note it in the other patch.
Superseded-By: #407