Skip to content

feat(bindings): expose disable_x509_intent_verification API#5703

Merged
CarolYeh910 merged 1 commit intoaws:mainfrom
CarolYeh910:add-cert-validation-rust-binding
Jan 15, 2026
Merged

feat(bindings): expose disable_x509_intent_verification API#5703
CarolYeh910 merged 1 commit intoaws:mainfrom
CarolYeh910:add-cert-validation-rust-binding

Conversation

@CarolYeh910
Copy link
Copy Markdown
Contributor

@CarolYeh910 CarolYeh910 commented Jan 14, 2026

Goal

Add rust binding for s2n_config_disable_x509_intent_verification() API

Why

Verifying certificate intent is a breaking change for some users. This disabling API serves as a workaround if impacted users can not update their invalid certs.

How

Invoke the FFI of the C function. I also added a ca_cert field to the CertKeyPair struct. Most of the unit tests pass the same cert/pem file to load_pem() and trust_pem(). However, we can not catch the CERT_INTENT_INVALID error in this way because our intent validation excludes the trust anchor. The unit test passed after I specified the correct CA cert.

Testing

Created a unit test to verify that given a certificate with invalid extensions,

  • handshake succeeded by calling the rust binding API
  • handshake failed due to CERT_INTENT_INVALID without the disabling API

Related

#5657

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jan 14, 2026
@CarolYeh910 CarolYeh910 added this pull request to the merge queue Jan 15, 2026
Merged via the queue into aws:main with commit 246c3e0 Jan 15, 2026
55 checks passed
@CarolYeh910 CarolYeh910 deleted the add-cert-validation-rust-binding branch January 15, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants