Closed hansonchar closed 1 year ago
Thanks for the report; I'll look into it.
This is related to https://github.com/marshallpierce/rust-base64/issues/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).
Give #198 a try and see if the error reporting works for your use case.
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.
Released in 0.20.0.
"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.