-
-
Notifications
You must be signed in to change notification settings - Fork 759
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
Use X509_PURPOSE_get_id instead of struct access #2115
Conversation
The accessor was added at the same version as the struct, so better to just use it. As with X509_PURPOSE_get_by_sname, it was const-corrected later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfackler are there backwards compataibility issues with making teh struct opaque?
Otherwise the PR looks good to me.
Yeah, we should really keep the struct definition as-is to preserve back compat. If you want, we could make it opaque for future open/boring/libre releases though. |
We will never, ever support using the handwritten bindings with BoringSSL because of memory safety, so I can just put it back. Though you all really should rethink the stability expectations there. |
On Sat, Dec 02, 2023 at 01:53:35PM -0800, Steven Fackler wrote:
Yeah, we should really keep the struct definition as-is to preserve back compat. If you want, we could make it opaque for future open/boring/libre releases though.
I think this is the least that should be done. The xstandard[] table
containing the standard purposes is static but not const in all three
libraries (I plan on changing that in libre).
X509_PURPOSE_get0() returns a pointer to it (or worse application
configured global mutable state if someone called X509_PURPOSE_add()),
so X509PurposeRef::from_idx() exposes a pointer to global mutable state
to Rust.
|
Oh, the entire X509PurposeRef API should be removed. It makes no sense in the first place. This is just the usual issue where binding APIs without thinking through use cases leads to problems. The only thing one can do with That means the only APIs here that made sense were the built-in |
BoringSSL will be doing that too. Note that, similar to #2113, it may run into a design flaw in foreign-types. From talking with @alex, it sounds like that crate uses exclusively I think I'll also just remove the APIs that |
The accessor was added at the same version as the struct, so better to just use it. As with X509_PURPOSE_get_by_sname, it was const-corrected later on.