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

Add custom error type for OpenSSL bindings #49

Merged
merged 1 commit into from
Feb 26, 2019

Conversation

mbestavros
Copy link
Contributor

This PR adds KeylimeCryptoError, a custom error type, to be used by all bindings in crypto.rs. This allows a uniform return type that handles a variety of different errors thrown by implementations of the crypto wrappers, without complex logic or loss of error information. More information can be found at the corresponding issue, #42.

Notes:

  • KeylimeCryptoError is not included as a return type for existing functions at the moment. I intend to update the existing bindings with the new error type in a separate PR.

  • Currently, KeylimeCryptoError preserves OpenSSL ErrorStack structs in their entirety by simply wrapping them. This allows further reference down the line if needed, though suggestions are welcome for simplification.

  • Right now, KeylimeCryptoError can handle std::io::Error and openssl::error::ErrorStack types; those two are the only ones that crypto.rs requires at the moment. Should new crypto bindings require additional error handling, these can be expanded accordingly.

Tagging @frozencemetery, @leonjia0112, @lukehinds for review.

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.

2 participants