Skip to content
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

[pkcs11-tool] --slot parameter expects ID in decimal form #2938

Closed
metsma opened this issue Nov 16, 2023 · 2 comments
Closed

[pkcs11-tool] --slot parameter expects ID in decimal form #2938

metsma opened this issue Nov 16, 2023 · 2 comments

Comments

@metsma
Copy link
Contributor

metsma commented Nov 16, 2023

Problem Description

pkcs11-tool --slot parameter expects ID in decimal format and --list-slots parameter prints slots in hex format.

Proposed Resolution

Specify that it excpects slot ID in decimal format or modify code to accept hex format.

Steps to reproduce

pkcs11-tool -L
Available slots:
Slot 0 (0x0): SafeNet Token JC
...
Slot 8 (0x10): 
...
pkcs11-tool -O --slot=10
error: PKCS11 function C_OpenSession failed: rv = CKR_SLOT_ID_INVALID (0x3)
Aborting.
pkcs11-tool -O --slot=16
Using slot with index 8 (0x10)
...
@popovec
Copy link
Member

popovec commented Nov 16, 2023

It should really be enough to use what pkcs11-tool -L lists in the brackets, i.e pkcs11-tool -O --slot=0x10

@metsma
Copy link
Contributor Author

metsma commented Nov 16, 2023

Oh I did not know, 0x10 works. Maybe then parameter documentation should be clarified.
I will try generate PR when I find some time.

metsma added a commit to metsma/OpenSC that referenced this issue Dec 1, 2023
@Jakuje Jakuje closed this as completed in 6bfa5b7 Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants