Skip to content

fix(signature): skeleton template in shared exc-C14N profile; xmlsec1 path verified + in CI - #27

Merged
karlkauc merged 1 commit into
mainfrom
fix/xmlsec1-profile
Aug 30, 2026
Merged

fix(signature): skeleton template in shared exc-C14N profile; xmlsec1 path verified + in CI#27
karlkauc merged 1 commit into
mainfrom
fix/xmlsec1-profile

Conversation

@karlkauc

Copy link
Copy Markdown
Contributor

Summary

Closes the last open signature item from the review: the xmlsec1 CLI variant now follows the same profile as Java/.NET and is verified, including in CI.

  • Skeleton template (FundsXML_Files/4.2.9/signed/Signed_Fund_Skeleton.xml): inclusive C14N + KeyName → exclusive C14N, enveloped + exc-C14N transforms, empty <ds:X509Certificate/> placeholder (XSD-valid). xmlsec1 signs it in place and embeds the signer cert.
  • VerifyFundsXml: Santuario exceptions while parsing/checking the signature (empty cert, malformed SignatureValue) now → INVALID, exit 1 (previously a MojoExecutionException stack trace on the unsigned skeleton).
  • CI: xmlsec1 installed; new step signs the skeleton via cli/sign-verify-xmlsec1.sh, verifies with xmlsec1 and Java (pinned + embedded), verifies the Java-signed file with xmlsec1, and asserts tamper detection.
  • Docs (script header, XML_Signature/README.md, signed/README.md, skeleton comment) describe the template/profile; CLI row marked verified.

Verification (local, xmlsec1 1.2.33 / JDK 26 / .NET 8)

check result
skeleton XSD-valid (unsigned and signed)
sign-verify-xmlsec1.sh sign skeleton → verify VALID
Java verify of xmlsec1 output — pinned / embedded VALID / VALID
.NET verify of xmlsec1 output VALID
xmlsec1 verify of Java-signed and .NET-signed files 0 / 0
tampered xmlsec1 output (xmlsec1) / tampered Java output (Java) exit 1 / exit 1
unsigned skeleton, Java verify embedded / pinned INVALID: Could not parse certificate… exit 1 / INVALID: Bad signature length… exit 1

🤖 Generated with Claude Code

https://claude.ai/code/session_01YXZWhwE5EbHSybt55K6oUZ

…mlsec1 path verified + in CI

The committed Signed_Fund_Skeleton.xml doubled as the xmlsec1 signing
template but used inclusive C14N, only the enveloped transform and a bare
ds:KeyName, so the xmlsec1 output did not follow the profile every other
stack uses (exclusive C14N, enveloped + exc-C14N transforms, RSA-SHA256,
signer cert embedded) and could not be verified from its embedded KeyInfo.

Switch the template to the shared profile and add an empty
<ds:X509Certificate/> placeholder (XSD-valid; xmlsec1 fills it from the
"key,cert" --privkey-pem pair). Verified with xmlsec1 1.2.33: sign -> verify,
tamper detected; the signed file is XSD-valid and verifies in Java (pinned
and embedded) and .NET; xmlsec1 verifies the Java- and .NET-signed files.

VerifyFundsXml: Santuario exceptions raised while parsing/checking the
signature (empty X509Certificate, malformed SignatureValue, ...) are
properties of the document under test - report INVALID / exit 1 instead of
a MojoExecutionException stack trace. The unsigned skeleton now exits 1
cleanly in both modes.

CI: install xmlsec1 and add a step that signs the skeleton with the CLI
script, verifies it with xmlsec1 and Java (pinned + embedded), verifies
the Java-signed file with xmlsec1, and checks tamper detection.

Docs: sign-verify-xmlsec1.sh header, XML_Signature/README.md (row + note),
FundsXML_Files/4.2.9/signed/README.md and the skeleton's header comment
describe the template/profile instead of the former mismatch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YXZWhwE5EbHSybt55K6oUZ
@karlkauc
karlkauc merged commit b5c6a0c into main Aug 30, 2026
4 checks passed
@karlkauc
karlkauc deleted the fix/xmlsec1-profile branch August 30, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant