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

Issues with current implementation of X509_PURPOSE constants #1782

Closed
bkstein opened this issue Jan 9, 2023 · 3 comments
Closed

Issues with current implementation of X509_PURPOSE constants #1782

bkstein opened this issue Jan 9, 2023 · 3 comments

Comments

@bkstein
Copy link
Contributor

bkstein commented Jan 9, 2023

I'm in the process of updating my PR #1598 branch and hit a problem with the implementation of X509_PURPOSE_xxx constants (

pub struct X509PurposeFlags: c_int {
).
First, these are currently implemented as bitflags!, but the way I see it, these constants are no bitflags. It compiles, but people might try to | the flags.
Second, there is an OpenSSL version restriction (#[cfg(ossl102)]) on the constants, but these constants already existed in 0.9.8 (and probably even earlier, but that's the oldest version I have checked out).
I wouldn't complain, but I have also implemented X509_PURPOSE_xxx in PR #1598 and now I have a conflict: shall I keep the existing version or shall I replace it with mine?

@sfackler
Copy link
Owner

sfackler commented Jan 9, 2023

Yeah, those definitely shouldn't be bitflags. Fortunately, there hasn't been a release with that type added yet, so we can just change it.

@bkstein
Copy link
Contributor Author

bkstein commented Jan 12, 2023

I will make a PR for this. I also think, it is better to move the X509_PURPOSE definitions from x509/verify.rs to x509/mod.rs, as it is also used by store.rs (X509StoreBuilderRef::set_purpose()).

@bkstein
Copy link
Contributor Author

bkstein commented Jan 13, 2023

Should be fixed with #1788.

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

No branches or pull requests

2 participants