Add round trip test for WolfSSLCertificate.setAuthorityKeyId()#362
Open
cconlon wants to merge 1 commit intowolfSSL:masterfrom
Open
Add round trip test for WolfSSLCertificate.setAuthorityKeyId()#362cconlon wants to merge 1 commit intowolfSSL:masterfrom
cconlon wants to merge 1 commit intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a regression/round-trip test to ensure WolfSSLCertificate’s Authority Key Identifier (AKID) setters produce RFC 5280-compliant encodings, and clarifies the public Javadoc around the expected AKID input format.
Changes:
- Add
testWolfSSLCertificateAuthorityKeyIdRoundtrip()plus helpers to sign, re-parse via JDKCertificateFactory, and assert AKID extension structure. - Add a runtime “behavioral probe” to skip the new test when running against native wolfSSL builds without the AKID encoder fix.
- Update Javadoc for
setAuthorityKeyId(byte[])andsetAuthorityKeyIdEx(...)to clarify the semantics of the input/derived key identifier.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/test/com/wolfssl/test/WolfSSLCertificateTest.java | Adds AKID round-trip test and DER parsing helpers to validate RFC 5280 AKID encoding. |
| src/java/com/wolfssl/WolfSSLCertificate.java | Clarifies Javadoc for AKID-related setters (raw key identifier vs pre-encoded ASN.1). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Waiting to move through review process until wolfSSL/wolfssl#10370 is merged. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improve the Javadoc on
setAuthorityKeyId(byte[])andsetAuthorityKeyIdExto specify that the byte argument is the raw key identifier value (not a pre-encodedAuthorityKeyIdentifierSEQUENCE), and call out the dependency on the wolfSSL AKID encoder fix in wolfSSL PR #10370.Adds new test
testWolfSSLCertificateAuthorityKeyIdRoundtrip(), which signs a cert with each setter, re-parses it viajava.security.cert.CertificateFactory, and makes sure the AKID extension matches the RFC 5280 4.2.1.1SEQUENCE { [0] keyIdentifier }. The test runs a check up front to auto-detect native AKID encoder state, so we just run the test if native wolfSSL has been fixed with the fix in wolfSSL PR #10370.