-
Notifications
You must be signed in to change notification settings - Fork 402
Modify CKR_ATTRIBUTE_READ_ONLY Error when generating ML-DSA key pair using pkcs11-tool #850
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,10 @@ if(WITH_CRYPTO_BACKEND STREQUAL "botan") | |
| message(STATUS "Botan: Support for EDDSA is disabled") | ||
| endif(ENABLE_EDDSA) | ||
|
|
||
| if(ENABLE_MLDSA) | ||
| set(WITH_ML_DSA 1) | ||
| endif(ENABLE_MLDSA) | ||
|
Comment on lines
+222
to
+224
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MLDSA currently does not work with Botan so this should be removed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would need Botan3 for that which is not currently supported. It will fail with Botan2. |
||
|
|
||
| # acx_botan_gost.m4 | ||
| if(ENABLE_GOST) | ||
| set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_botan_gost.cpp) | ||
|
|
@@ -370,6 +374,10 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl") | |
| message(STATUS "OpenSSL: Support for EDDSA is disabled") | ||
| endif(ENABLE_EDDSA) | ||
|
|
||
| if(ENABLE_MLDSA) | ||
| set(WITH_ML_DSA 1) | ||
| endif(ENABLE_MLDSA) | ||
|
|
||
| # acx_openssl_gost.m4 | ||
| if(ENABLE_GOST) | ||
| set(testfile ${CMAKE_SOURCE_DIR}/cmake/modules/tests/test_openssl_gost.c) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -440,8 +440,11 @@ CK_RV P11Attribute::update(Token* token, bool isPrivate, CK_VOID_PTR pValue, CK_ | |
| { | ||
| if (OBJECT_OP_GENERATE==op) | ||
| { | ||
| ERROR_MSG("Prohibited attribute was passed to key generation function"); | ||
| return CKR_ATTRIBUTE_READ_ONLY; | ||
| if (type != CKA_PARAMETER_SET) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit hacky. I might need to debug it to see what the actual reason for this. |
||
| { | ||
| ERROR_MSG("Prohibited attribute was passed to key generation function"); | ||
| return CKR_ATTRIBUTE_READ_ONLY; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -2593,4 +2596,4 @@ CK_RV P11AttrSeed::updateAttr(Token *token, bool isPrivate, CK_VOID_PTR pValue, | |
| osobject->setAttribute(type, value); | ||
|
|
||
| return CKR_OK; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: softhsm/SoftHSMv2
Length of output: 603
🏁 Script executed:
Repository: softhsm/SoftHSMv2
Length of output: 8909
🏁 Script executed:
Repository: softhsm/SoftHSMv2
Length of output: 4197
🏁 Script executed:
# List all files in cmake/modules/tests to see what probes exist ls -la cmake/modules/tests/Repository: softhsm/SoftHSMv2
Length of output: 1088
🏁 Script executed:
Repository: softhsm/SoftHSMv2
Length of output: 595
Add ML-DSA backend capability probes for both OpenSSL and Botan, following the pattern used for ECC, EDDSA, and GOST.
Lines 222–224 (Botan) and 377–379 (OpenSSL) set
WITH_ML_DSAunconditionally whenENABLE_MLDSAis ON. If the selected backend lacks ML-DSA support, configuration succeeds but compilation or linking fails later. Create test files (test_openssl_mldsa.candtest_botan_mldsa.cpp) and usetry_runprobes withFATAL_ERRORon failure, matching the existing pattern for ECC, EDDSA, and GOST.🤖 Prompt for AI Agents