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

Fixed panic with invalid RSA private keys #19

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Conversation

Hirevo
Copy link
Owner

@Hirevo Hirevo commented Mar 19, 2024

Previously, whenever we encountered an RSA private key that was unable to be decoded (which can happen during the login ceremony), the library would panic.

This is undesirable, we should instead communicate this issue to the user in a more graceful fashion, using a proper error variant, so that users of the library can react accordingly if they wish so.

This PR does precisely this: it transforms what was previously a panic into a new proper error Error::InvalidRsaPrivateKeyFormat variant.

Closes #18.

@Hirevo Hirevo self-assigned this Mar 19, 2024
@Hirevo Hirevo added C-enhancement Category: Enhancement P-medium Priority: Medium labels Mar 19, 2024
@Hirevo Hirevo merged commit e93a7b6 into main Mar 19, 2024
2 checks passed
@Hirevo Hirevo deleted the fix/rsa-key-format branch March 19, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement P-medium Priority: Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertion error in rsa.rs
1 participant