-
Notifications
You must be signed in to change notification settings - Fork 1
feat(xmldsig): complete Merlin interop #106
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
polaz
wants to merge
25
commits into
main
Choose a base branch
from
feat/#105-merlin-interop
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
25 commits
Select commit
Hold shift + click to select a range
164a9bb
feat(xmldsig): complete Merlin interop
polaz d9a013c
fix(xmldsig): address Merlin review findings
polaz e0ac4b2
fix(xmldsig): harden retrieval methods
polaz 8fd4a48
fix(xmldsig): harden key retrieval
polaz 155520b
fix(xmldsig): harden key source handling
polaz 06f6749
fix(xmldsig): track xmlsec1 1.3.13
polaz fbfb5c7
fix(xmldsig): ignore CryptoBinary comments
polaz 2304206
fix(xmldsig): harden external references
polaz fa4a088
ci: unpin stale cargo-fuzz lockfile
polaz 9f3017b
fix(xmldsig): harden interop boundaries
polaz f9e1e5f
fix(ci): verify immutable interop inputs
polaz 6905e49
fix(ci): use maintained action refs
polaz eb1840e
fix(xmldsig): harden interop setup
polaz 3bc02d1
fix(xmldsig): honor matching context
polaz bcdccc4
fix(xmldsig): preserve resolution context
polaz 3ec3a96
fix(xmldsig): harden resolution edge cases
polaz 88541da
fix(xmldsig): close URI and trust edge cases
polaz c1d0bd7
fix(xmldsig): harden fallback resolution
polaz abd05ed
fix(xmldsig): unify detached parse policy
polaz 1a8d77b
fix(xmldsig): enforce URI and X.509 invariants
polaz 9c0cd48
fix(xmldsig): enforce signature-wide limits
polaz ddb8153
fix(xmldsig): harden bounded verification
polaz 83f35c6
fix(xmldsig): defer malformed retrievals
polaz 7b56c38
fix(security): unify policy and provider
polaz 7cae909
fix(security): enforce policy invariants
polaz 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| tests/fixtures/xmlenc/aleksey-xmlenc-01/*.tmpl -text whitespace=-trailing-space,-space-before-tab | ||
| tests/fixtures/xmlenc/01-phaos-xmlenc-3/** -text whitespace=-trailing-space,-space-before-tab | ||
| tests/fixtures/xmldsig/merlin-xmldsig-twenty-three/** -text whitespace=-blank-at-eof |
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
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,22 @@ | ||
| [package] | ||
| name = "xml-sec-fuzz" | ||
| version = "0.0.0" | ||
| publish = false | ||
| edition = "2024" | ||
|
|
||
| [package.metadata] | ||
| cargo-fuzz = true | ||
|
|
||
| [dependencies] | ||
| libfuzzer-sys = "0.4.13" | ||
| xml-sec = { path = "..", features = ["xmldsig"] } | ||
|
|
||
| [[bin]] | ||
| name = "xmldsig_verify" | ||
| path = "fuzz_targets/xmldsig_verify.rs" | ||
| test = false | ||
| doc = false | ||
| bench = false | ||
|
|
||
| [workspace] | ||
| members = ["."] |
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 @@ | ||
| <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"/> |
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,34 @@ | ||
| #![no_main] | ||
|
|
||
| use std::sync::OnceLock; | ||
|
|
||
| use libfuzzer_sys::fuzz_target; | ||
| use xml_sec::xmldsig::{DefaultKeyResolver, KeyResolverConfig, UriTypeSet, VerifyContext}; | ||
|
|
||
| const TRUSTED_CERTIFICATE: &[u8] = | ||
| include_bytes!("../../tests/fixtures/xmldsig/phaos-xmldsig-three/certs/rsa-cert.der"); | ||
|
|
||
| fn resolver() -> &'static DefaultKeyResolver { | ||
| static RESOLVER: OnceLock<DefaultKeyResolver> = OnceLock::new(); | ||
| RESOLVER.get_or_init(|| { | ||
| DefaultKeyResolver::new(KeyResolverConfig { | ||
| lookup_certs: vec![TRUSTED_CERTIFICATE.to_vec()], | ||
| ..KeyResolverConfig::default() | ||
| }) | ||
| }) | ||
| } | ||
|
|
||
| fuzz_target!(|data: &[u8]| { | ||
| let Ok(xml) = std::str::from_utf8(data) else { | ||
| return; | ||
| }; | ||
|
|
||
| // Match the upstream 1.3.13 verification harness: exercise parsing, | ||
| // transforms, digesting, signature verification, and X.509 lookup while | ||
| // keeping every reference and key retrieval strictly in-document. | ||
| let _ = VerifyContext::new() | ||
| .key_resolver(resolver()) | ||
| .allowed_uri_types(UriTypeSet::SAME_DOCUMENT) | ||
| .allowed_retrieval_method_uri_types(UriTypeSet::SAME_DOCUMENT) | ||
| .verify(xml); | ||
| }); |
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.
Uh oh!
There was an error while loading. Please reload this page.