New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with label formatting in C_GetTokenInfo / opensc 0.20.0 #1922
Comments
|
Duplicate of #1901 Sorry for the inconvenience. |
|
I may have closed this too quickly. Do I read correctly, that your label is padded with spaces in the front?! |
|
Thank you for checking #1901 - this explains (2) but (1) still needs attention.
Seems spaces added in the front of "IBHS001 (UserPIN)" in pkcs11-tool -T output in 0.20.0 like above are caused by fprintf (%32.32s) used in pkcs11-display.c for displaying label... https://github.com/OpenSC/OpenSC/blob/master/src/pkcs11/pkcs11-display.c#L928 ...and are not part of label - displaying label works here ok. Label value returned by C_GetTokenInfo seems to be "IBHS001 (UserPIN)" but should be "IBHS001 (UserPIN)<15x space here>" (see oasis info above). After fixing 0.20.0, pkcs11-tool -T command should NOT probably display but |
|
please check if #1926 fixes the padding |
|
Just compiled 0.20.0 with fix #1926 applied (Debian 10) and now label works ok. Thank you! Regards, |
Hello,
There seems to be a problem with label formatting in C_GetTokenInfo in opensc 0.20.0 (compiled in debian 10 from sources https://github.com/OpenSC/OpenSC/releases):
original opensc 0.19.0-1 from dpkg in debian 10 returns:
This breaks apps like
(*) https://github.com/miekg/pkcs11/blob/master/pkcs11.go#L866
that seems to expect label to be formatted according to
http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html
Debug show, that app (*) reads label as "IBHS001 (UserPIN)<here 15x zero byte>"
Problems:
(1)
Seems that label returned by C_GetTokenInfo from opensc 0.20.0 does not contain padding with spaces - it just ends after last letter. No such problem in manufacturerID field.
(2)
Order of label/pin in final label returned by C_GetTokenInfo is different in 0.19.0 and 0.20.0:
IBHS001 (UserPIN) != UserPIN (IBHS001)Is it intentional (may require config changes after upgrade to 0.20.0 if one uses label as parameter).
Regards,
Paweł
The text was updated successfully, but these errors were encountered: