-
Notifications
You must be signed in to change notification settings - Fork 59
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
Implementation of the HKDF derivation function #271
Implementation of the HKDF derivation function #271
Conversation
@coheigea please note that we did not yet receive final feedback from IETF regarding the I will let you know when this PR will be finalized for the review. |
Hi @coheigea I want to inform you that the update for HKDF xsd scheme for RFC9231 |
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.
@seanjmullan Can you have a look as well please?
src/main/java/org/apache/xml/security/encryption/XMLCipherUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDFParamsImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDFParamsImpl.java
Show resolved
Hide resolved
src/test/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDFTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDFTest.java
Outdated
Show resolved
Hide resolved
@jrihtarsic I'm going to call a vote on 4.0.2/3.0.4 to get the Key Agreement feature released and unblock the next CXF release. The HKDF will have to wait until the next release. |
@coheigea understand and thanks for the info. I look forward to the first version of the key agreement option as part of the cxf. |
I can try to look at this over the next couple of weeks. I was off work for a while so I am still catching up with things. |
…security-java into ec-edelivery-key-agreement-hkdf
@seanjmullan Just a reminder please, as this PR blocks another Pr in WSS4J |
@jrihtarsic Can you remove the whitespace changes in this PR? It makes it difficult to get to the actual changes |
I reverted the "cleaning of the code" (empty lines) from commit PR updates (docs and clean empty lines) |
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.
I reviewed some of it, so far just a few minor comments. Will need another day or two to finish reviewing.
src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/resource/xmlsecurity_en.properties
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/KeyDerivationMethod.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/params/HKDFParams.java
Outdated
Show resolved
Hide resolved
@seanjmullan Thank you for checking it. And no worries about time. I'd rather see my code thoroughly vetted by a security expert than to skip/miss some security issues or bugs. So take as much time as you need. |
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.
Still reviewing, but here are some more comments.
src/main/java/org/apache/xml/security/encryption/KeyDerivationMethod.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/KeyDerivationMethod.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/KeyDerivationMethod.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/KDFParams.java
Outdated
Show resolved
Hide resolved
...java/org/apache/xml/security/encryption/keys/content/derivedKey/KeyDerivationMethodImpl.java
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/params/HKDFParams.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/XMLCipherUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDF.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDF.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDF.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDF.java
Outdated
Show resolved
Hide resolved
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.
Updates looks good.
src/main/java/org/apache/xml/security/encryption/XMLCipherUtil.java
Outdated
Show resolved
Hide resolved
…Utils.constructKeyDerivationParameter
src/main/java/org/apache/xml/security/encryption/XMLCipherUtil.java
Outdated
Show resolved
Hide resolved
@seanjmullan Is it ready to be merged from your PoV? |
@jrihtarsic There is a build error:
|
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDF.java
Fixed
Show resolved
Hide resolved
src/main/java/org/apache/xml/security/encryption/keys/content/derivedKey/HKDF.java
Fixed
Show fixed
Hide fixed
The branch is now updated with latest changes from the main, the build after the merge should pass now. |
Yes, although I think we should try to add the secureValidation mode support before we post the next release. |
|
@jrihtarsic Do you need this merged to 3.0.x as well? |
@coheigea, yes indeed we would need it in 3.0.x so that we can use the latest feature with current apache/cxf |
…JCEMapper.translateURItoJCEID
* HKDF derivation function * HKDF derivation function updates * PR updates (docs and clean empty lines) * Revert cleaning the code: empty lines from commit 491a7d3 * PR: Update comments * Fix PR comments * Fix PR comments * change XMLSecurityException with XMLEncryptionException for XMLCipherUtils.constructKeyDerivationParameter * fx the type in the documentation * Update branch with changes on main 'main' to fix build after merge * Rename the confusing overloading of methods KeyUtils.deriveKeyEncryptionKey * Remove XMLChipper.getJCEMacHashForUri URI/JCE name mapping and reuse JCEMapper.translateURItoJCEID --------- Co-authored-by: RIHTARSIC Joze <joze.rihtarsic@ext.ec.europa.eu>
Purpose of the PR is to implement support for the HMAC-based Extract-and-Expand Key Derivation Function (HKDF [RFC5869]) used by the KeyAgreement method.
The details of the PR are in the ticket SANTUARIO-607
The code is contributed on behalf of the European Commission’s edelivery project to support eDelivery AS4 2.0 profile.