-
Notifications
You must be signed in to change notification settings - Fork 17
Update algorithm names to match CycloneDX schema #362
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?
Conversation
Updates algorithm naming conventions in mapper model to align with the CycloneDX cryptography-defs.json specification: - SHA1 → SHA-1, SHA256 → SHA-256, SHA384 → SHA-384, SHA512 → SHA-512 - SHA3-* → SHA-3-* (e.g., SHA3-256 → SHA-3-256) - ChaCha20Poly1305 → ChaCha20-Poly1305 - RSASSA-PSS → RSA-PSS - DH → FFDH (Finite Field Diffie-Hellman) - KDF in Counter Mode → SP800-108-CounterKDF - KDF in Feedback Mode → SP800-108-FeedbackKDF - SPHINCS+ → SLH-DSA Also adds CycloneDX schema JavaDoc references to algorithm classes and updates test assertions across all language modules (Java, Python, Go). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bhess
left a comment
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.
Excellent!
Did you run an automatic check to verify that the patterns match?
I noticed a few that don’t, see the inline comments.
| PasswordBasedEncryption pbe = pbeOpt.get(); | ||
| assertThat(pbe.getName()).isEqualTo("PBES1"); | ||
| assertThat(pbe.asString()).isEqualTo("pbeWithHmacSHA256AndAES"); | ||
| assertThat(pbe.asString()).isEqualTo("pbeWithHmacSHA-256AndAES"); |
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.
See the pattern here: https://github.com/CycloneDX/specification/blob/8c16b5c89503657e14d618bd6851c416707a244b/schema/cryptography-defs.json#L1404
Should be
PBES1-AES-HMAC-SHA-256
|
|
||
| // Initialize RSADigestSigner | ||
| RSADigestSigner signer = new RSADigestSigner(digest, new ASN1ObjectIdentifier("1234")); | ||
| // Noncompliant@-1 {{(Signature) SHA256withRSA}} |
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.
This maps to RSA RSA-PKCS1-1.5-SHA-256, see
https://github.com/CycloneDX/specification/blob/8c16b5c89503657e14d618bd6851c416707a244b/schema/cryptography-defs.json#L19C23-L19C56
Similarly, all other patterns in the PR using "XYZwithRSA" or "XYZwithDSA" should be adapted.
|
This mapping isn't strictly true: |
Summary
Naming changes:
Test plan
mvn spotless:apply🤖 Generated with Claude Code