-
Notifications
You must be signed in to change notification settings - Fork 387
feat(signature): implement SLH-DSA using OpenSSL #823
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
Open
JoaoHenrique12
wants to merge
22
commits into
softhsm:main
Choose a base branch
from
JoaoHenrique12:jp-implement-slh-dsa
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6655c15
feat: add initial dockerfile do easier the build
JoaoHenrique12 af467c3
feat: using openssl 3.5.1 to build softhsmv2
JoaoHenrique12 4fa5d9c
chore: dockerfile remove ecc keys, enable only eddsa
JoaoHenrique12 48e8cc6
fix: install opensc and pkcs11 at begining
JoaoHenrique12 ae0a50e
docs: remove logs used on exploratory process
JoaoHenrique12 ddfc875
feat: duplicate eddsa (#2)
JoaoHenrique12 7988efa
chore: remove library hpcs-pkcs11 from softhsmv2
JoaoHenrique12 907ffb2
feat: update pkcs11 client and add slh-dsa signature (#3)
JoaoHenrique12 07a76cb
chore: remove dockerfile used on developing process
JoaoHenrique12 bb16d37
test(unit): slhdsa keypair tests added (#5)
JoaoHenrique12 21a981f
chore: clean repo, removing exploratory logs, hpkcs11 and Dockerfile
JoaoHenrique12 c4d6e59
fix(coderabbit): issue about ';' on error log, removed additional logs
JoaoHenrique12 778e412
fix(coderabbit): remove guard for slhdsa on oid operations
JoaoHenrique12 f0a9949
fix(coderabbit): return correct min/max size on OSSLSLHDSA.cpp
JoaoHenrique12 811dfdf
test(coderabbit): fix bytestring size for slhdsa names with shake
JoaoHenrique12 8f620de
fix(coderabbit): deriveKey, this function is not covered by slh-dsa
JoaoHenrique12 4296151
fix(coderabbit): by default detect slh-dsa on m4 files
JoaoHenrique12 5110c12
fix: by default disable slhdsa
JoaoHenrique12 ee5d1e2
fix(coderabbit): minor errors, messages and identation on m4 file
JoaoHenrique12 e050475
refactor(coderabbit): dry, applied on define key size for slh-dsa
JoaoHenrique12 05eb70c
fix: remove test file, data.txt
JoaoHenrique12 3db0676
fix(coderabbit): minor issue on OSSLSLHPrivateKey.h, comment
JoaoHenrique12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| AC_DEFUN([ACX_OPENSSL_SLHDSA],[ | ||
| AC_MSG_CHECKING(for OpenSSL SLHDSA support) | ||
|
|
||
| tmp_CPPFLAGS=$CPPFLAGS | ||
| tmp_LIBS=$LIBS | ||
|
|
||
| CPPFLAGS="$CPPFLAGS $CRYPTO_INCLUDES" | ||
| LIBS="$CRYPTO_LIBS $LIBS" | ||
|
|
||
| AC_LANG_PUSH([C]) | ||
| AC_CACHE_VAL([acx_cv_lib_openssl_slhdsa_support],[ | ||
| acx_cv_lib_openssl_slhdsa_support=no | ||
| AC_RUN_IFELSE([ | ||
| AC_LANG_SOURCE([[ | ||
| #include <openssl/evp.h> | ||
| #include <openssl/objects.h> | ||
| int main() | ||
| { | ||
| EVP_PKEY_CTX *ctx; | ||
| ctx = EVP_PKEY_CTX_new_from_name(NULL, "SLH-DSA-SHA2-128f", NULL); | ||
| if (ctx == NULL) | ||
| return 1; | ||
| return 0; | ||
| } | ||
| ]]) | ||
| ],[ | ||
| AC_MSG_RESULT([Found SLHDSA]) | ||
| acx_cv_lib_openssl_slhdsa_support=yes | ||
| ],[ | ||
| AC_MSG_RESULT([Cannot find SLHDSA]) | ||
| acx_cv_lib_openssl_slhdsa_support=no | ||
| ],[ | ||
| AC_MSG_WARN([Cannot test, SLHDSA]) | ||
| acx_cv_lib_openssl_slhdsa_support=yes | ||
| ]) | ||
| ]) | ||
| AC_LANG_POP([C]) | ||
|
|
||
| CPPFLAGS=$tmp_CPPFLAGS | ||
| LIBS=$tmp_LIBS | ||
| have_lib_openssl_slhdsa_support="${acx_cv_lib_openssl_slhdsa_support}" | ||
| ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Critical: Incorrect attribute usage for SLHDSA keys.
The CKA_SLHDSA_PARAMS attribute is being used to store the entire DER-encoded public/private key, but it should only contain the algorithm parameters (e.g., the variant name like "SLH-DSA-SHA2-128s"). The actual key material should be in CKA_VALUE or a similar attribute.
Compare with EdDSA (lines 1000-1026):
For SLHDSA, you should:
This aligns with the PR description noting that "private/public key values are stored DER-encoded without separating key attributes" as a limitation to be addressed.
🤖 Prompt for AI Agents