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

Successfully decode invalid input #189

Closed
hansonchar opened this issue Jul 19, 2022 · 5 comments
Closed

Successfully decode invalid input #189

hansonchar opened this issue Jul 19, 2022 · 5 comments
Assignees

Comments

@hansonchar
Copy link

hansonchar commented Jul 19, 2022

"djAuMC4x" is a valid base-64 encoded string whereas "djAuMC4" is not.

However, the latest v0.13.0 decodes both strings successfully when decoding the invalid one should fail.

@marshallpierce
Copy link
Owner

Thanks for the report; I'll look into it.

@marshallpierce marshallpierce self-assigned this Jul 19, 2022
@marshallpierce
Copy link
Owner

This is related to #182. Since padding doesn't perform any useful function, the decode logic does not currently require it.

I have some in-progress work to make padding required by default (but configurable to require no padding, or be indifferent).

@marshallpierce
Copy link
Owner

Give #198 a try and see if the error reporting works for your use case.

@hansonchar
Copy link
Author

hansonchar commented Dec 1, 2022

Great, it works!

thread 'main' panicked at 'Failed to base 64 decode the ciphertext metadata configured due to "Invalid padding"', src/settings.rs:198:27

It failed when the invalid input "djAuMC4" is base 64 decoded vs. "djAuMC4x" which passed.

@marshallpierce
Copy link
Owner

Released in 0.20.0.

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