Mastercard / pkcs11-tools

A set of tools to manage objects on PKCS#11 cryptographic tokens. Compatible with many PKCS#11 library, including major HSM brands, NSS and softoken.
Other
162 stars 33 forks source link

Some wrong names for hashes and MGF in the manual #30

Closed ceridwen closed 3 years ago

ceridwen commented 3 years ago

Under https://github.com/Mastercard/pkcs11-tools/blob/master/docs/MANUAL.md#p11wrap-and-p11unwrap,

mgf=CKG_MGF1_SHA1|CKG_MGF1_SHA256|CKG_MGF_SHA384|CKG_MGF_SHA512 - MGF parameter, default is CKG_MGF1_SHA1 hash=CKM_SHA_1|CKM_SHA224|CKM_SHA256|CKM_SHA384|CKM_SHA512 - hashing alg. argument, default is CKM_SHA_1

These are not the same as the mechanisms listed in the standard. Yesterday I was trying unwrapping and wrapping and couldn't figure out why I was getting errors until I looked the mechanisms up.

keldonin commented 3 years ago

Hi @ceridwen, the problem I see is in the documentation, where CKG_MGF_SHAxxx should be CKG_MGF1_SHAxxx instead. I'll fix that, is there anything else I may have missed?

keldonin commented 3 years ago

Actually the documentation is inferred from the help string produced when specifying the -h argument to a command, which means that the documentation in the commands p11wrap, p11keygen and p11rewrap must be adjusted as well.

keldonin commented 3 years ago

The changes have been added to the masterbranch, but not issued as a new release yet. Please check it out to see if it addresses your issue entirely.

Thank you for your contribution,

ceridwen commented 3 years ago

Looks good to me.