Skip to content

Set default certificate validation policy to require digitalSignature key usage#292

Merged
kislyuk merged 1 commit into
XML-Security:mainfrom
U-238:main
Jun 13, 2026
Merged

Set default certificate validation policy to require digitalSignature key usage#292
kislyuk merged 1 commit into
XML-Security:mainfrom
U-238:main

Conversation

@U-238

@U-238 U-238 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

signxml.util.X509CertChainVerifier currently uses the default extension policy from x509.verification.PolicyBuilder().build_client_verifier(), which requires the signer's certificate to have the "TLS Web Client Authentication" extended key usage extension. However, this extension is not a requirement to sign documents using XMLDSig. It should be sufficient for the signer's certificate to have only the "Digital Signature" key usage extension.

This is causing validation failures on valid XML signatures where the certificate lacks the "TLS Web Client Authentication" extended key usage extension.

This pull request:

  1. Sets the default ExtensionPolicy to require only that the signer's certificate has the "Digital Signature" key usage extension.
  2. Adds ee_policy and ca_policy kwargs to XMLVerifier.verify() to allow the ExtensionPolicy to be overridden if desired.

… key usage, and allow overriding of EE and CA validation policies.
@kislyuk kislyuk merged commit d19085d into XML-Security:main Jun 13, 2026
1 of 26 checks passed
@kislyuk

kislyuk commented Jun 13, 2026

Copy link
Copy Markdown
Member

This is great, thanks! Release coming up.

@kislyuk

kislyuk commented Jun 13, 2026

Copy link
Copy Markdown
Member

While the ability to set this requirement is useful, I am going to have to set this to off by default because there are plenty of uses out there that use certificates without this key usage set.

@U-238

U-238 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the very quick turnaround! I agree with your change to not require the "Digital Signature" key usage in order to avoid breaking existing implementations, however, the default should not require the "TLS Web Client Authentication" extended key usage either. I have submitted #293 to use a more permissive default that does not require the certificate to contain either of these extensions.

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.

2 participants