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: let -m accept hexadecimal strings, e.g., 0x80001234 #1302

Merged
merged 1 commit into from
Mar 31, 2018

Conversation

aalba6675
Copy link
Contributor

@aalba6675 aalba6675 commented Mar 27, 2018

Checklist
  • Documentation is added or updated
  • New files have a LGPL 2.1 license statement
  • Tested with the following card:
    • tested PKCS#11
    • tested Windows Minidriver
    • tested macOS Tokend

Fixes #1301: convert user specified mechanisms -m mechtype-0xNNNNNNNN to UL (CK_MECHANISM_TYPE).

To work with vendor HSMs that require proprietary mechanisms such as AWS CloudHSM in FIPS-mode which uses 0x80000142 0x80000143 for RSA keypairgen instead of the pkcs11-tool defaults of CKM_RSA_PKCS_KEY_PAIR_GEN, CKM_RSA_X9_31_KEY_PAIR_GEN


[UPDATE] remove mechtype- as prefix, specify mechanism-in-hex as -m 0x80001234 for example


[UPDATE] updated XML documentation

@aalba6675
Copy link
Contributor Author

aalba6675 commented Mar 27, 2018

When we list mechanisms we output mechtype-0x8000XXXX for unknown stuff, so the PR reuses that convention for input of vendor mechanism.

@aalba6675 aalba6675 changed the title pkcs11-tool: handle mechtype-0x for -m pkcs11-tool: let -m accept hexadecimal strings, e.g., 0x80001234 Mar 29, 2018
@aalba6675
Copy link
Contributor Author

aalba6675 commented Mar 29, 2018

PR updated(and squashed), per @dengert comment #1301 (comment)

@frankmorgner
Copy link
Member

Please also update doc/tools/pkcs11-tool.1.xml, thanks

To support vendor mechanisms, let -m accept hexadecimal strings,
e.g., -m 0x80001234
@aalba6675
Copy link
Contributor Author

Updated doc/tools/pkcs11-tool.1.xml and squashed. Thanks.

@frankmorgner
Copy link
Member

thanks!

@frankmorgner frankmorgner merged commit 74885fb into OpenSC:master Mar 31, 2018
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

Successfully merging this pull request may close these issues.

pkcs11-tool: allow specifying vendor mechanism in hex like -m mechtype-0x8000xxxx
2 participants