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

CKR_MECHANISM_INVALID when using CKM_ECDSA_SHA384 #104

Open
sdalgic opened this issue Sep 22, 2023 · 1 comment
Open

CKR_MECHANISM_INVALID when using CKM_ECDSA_SHA384 #104

sdalgic opened this issue Sep 22, 2023 · 1 comment
Assignees

Comments

@sdalgic
Copy link

sdalgic commented Sep 22, 2023

# Your system information

  • Operating system used:Ubuntu 20.04
  • PyKCS11 version: 1.5.12
  • Python version: 3.6
  • PKCS#11 library used: libsofthsm2.so and /lib64/libprocryptoki.so

# Please describe your issue in as much detail as possible:
Describe what you expected should happen.
While trying to sign a data by using CKM_ECDSA_SHA384 mechanism with soft hsm and also hard hsm, the same problem occurs.
signature = session.sign(priv_key, byte_data, Mechanism(CKM_ECDSA_SHA384, None))

Describe what did happen.
When sign method is executed, it returns below exception.
Exception : CKR_MECHANISM_INVALID (0x00000070)

# Steps for reproducing this issue:

  1. Install SoftHSM
  2. Import EC keys into SoftHSM
  3. Sign data with CKM_ECDSA_SHA384 mechanism.
@LudovicRousseau LudovicRousseau self-assigned this Sep 23, 2023
@LudovicRousseau
Copy link
Owner

SoftHSM v2 does not support CKM_ECDSA_SHA384, only CKM_ECDSA.
You can use getinfo.py to list all the supported mechanisms:

PYKCS11LIB=/usr/local/lib/softhsm/libsofthsm2.so samples/getinfo.py --mechanisms | grep CKM_ECDSA
   CKM_ECDSA 

I guess it the same with your /lib64/libprocryptoki.so.

If you can provide a working sample C code using SoftHSMv2 and CKM_ECDSA_SHA384 then I can re-consider this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants