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

New X509D2iError to improve error checking for X509_ext_get_d2i() #2240

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

HolyShitMan
Copy link

@HolyShitMan HolyShitMan commented May 17, 2024

First try to fix #2226:
New X509D2iError which represents the errors that can occur after calling X509_ext_get_d2i()

pub enum X509D2iError {
    InternalOpenSSLError(ErrorStack),
    ExtensionNotFoundError,
    ExtensionAmbiguousError,
}

All corresponding X509_ext_get_d2i() calls are adapted accordingly to not return Option<...>, but a Result. ExtensionNotFoundError is handled as None before.

If you got other ideas or expectations let me know.

@HolyShitMan HolyShitMan changed the title New x509d2i error to improve error checking for X509_ext_get_d2i() New x509D2iError to improve error checking for X509_ext_get_d2i() May 21, 2024
@HolyShitMan HolyShitMan changed the title New x509D2iError to improve error checking for X509_ext_get_d2i() New ``509D2iError to improve error checking for X509_ext_get_d2i() May 21, 2024
@HolyShitMan HolyShitMan changed the title New ``509D2iError to improve error checking for X509_ext_get_d2i() New X509D2iError to improve error checking for X509_ext_get_d2i() May 21, 2024
@HolyShitMan
Copy link
Author

Hi @botovq,
I have a couple of questions regarding this PR:

Thank you!

Copy link
Contributor

@botovq botovq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach looks sensible to me. I do not know when and how this crate is willing to do breaking changes to its public API. Maybe the less brutal way to do it would be to deprecate the existing API and point at new variants that return Result<_, X509D2iError>. It might even be possible to make the existing API wrappers of the new API that map the X509D2iError to None (this has upsides and downsides).

That's @sfackler and @alex's call, though.

openssl/src/error.rs Outdated Show resolved Hide resolved
openssl/src/error.rs Outdated Show resolved Hide resolved
openssl/src/error.rs Outdated Show resolved Hide resolved
@HolyShitMan
Copy link
Author

The approach looks sensible to me. [...]

@sfackler or @alex: Could you please share your thoughts on this? This MR has been open for a month without significant updates, and #2053, which is related, is open since October. We aim to close both so we can resume using the upstream repository in our dependencies.

@HolyShitMan
Copy link
Author

@sfackler or @alex: Could you please share your thoughts on this? This MR has been open for a month without significant updates, and #2053, which is related, is open since October. We aim to close both so we can resume using the upstream repository in our dependencies.

Hi @sfackler and @alex, I hope you’re both doing well. I wanted to follow up on the message above. Both issues have been open for a considerable time now, and we're really eager to close them out so we can get back to using the upstream repository. Could you please share your thoughts or provide an update on the current status? If there's anything we can do to help move things forward, we’re more than happy provide them.

@HolyShitMan
Copy link
Author

Hey @sfackler & @alex,
just a quick reminder that this PR is still uncomment by you guys and that there is another PR that depends on this one being resolved.

Best regards

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.

Improve error checking for X509_ext_get_d2i()
2 participants