Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
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

ExtensionPolicy changes required for Python callback support. #12417

Merged
merged 3 commits into from
Feb 8, 2025

Conversation

deivse
Copy link
Contributor

@deivse deivse commented Feb 8, 2025

Should be merged after #12416, will rebase if there are any changes there. Creating as draft for now.

This PR changes the validator callback types to allow storing python callbacks in them.
The callback types have to be Send and Sync to allow the ExtensionPolicy to be stored inside a PyExtensionPolicy pyclass. They are Arc to be able to clone the ExtensionPolicy, which is required for the builder-style API of PyExtensionPolicy.

Hopefully this makes sense on it's own. I was originally going to include this as part of a larger PR adding all the functionality required to expose extension policies to python, but that was getting too big.

@deivse
Copy link
Contributor Author

deivse commented Feb 8, 2025

The just added VerificationCertificate change is so that extension validation callbacks have access to CertificateExtra. Specifically so that the original python certificate object is accessible when invoking a python extension validation callback. Originally I used a pretty awful hack, creating a PyCertificate from the rust certificate by serializing and deserializing from asn1.

@deivse deivse changed the title Add public ExtensionPolicy constructors for webpki policies. ExtensionPolicy changes required for Python callback support. Feb 8, 2025
@alex
Copy link
Member

alex commented Feb 8, 2025

Just wanted to give you a huge thank you for your work splitting this apart, it's making things much easier to review.

@deivse
Copy link
Contributor Author

deivse commented Feb 8, 2025

No worries! Not sure why Github still shows the first commit as part of this PR though, since it's the same one as in the one you just merged

@deivse
Copy link
Contributor Author

deivse commented Feb 8, 2025

Oh I get it, it's because you don't use fast-forward. I'll force push this in a second then.

@alex
Copy link
Member

alex commented Feb 8, 2025

Yeah, if you rebase on main it should do the right thing.

@deivse deivse force-pushed the x509_verification_prepare_for_py_callbacks branch from c5026c5 to b4351c0 Compare February 8, 2025 15:11
@deivse deivse marked this pull request as ready for review February 8, 2025 15:12
@alex alex merged commit 2734b15 into pyca:main Feb 8, 2025
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants