]> git.ipfire.org Git - thirdparty/coreutils.git/commit
basenc: auto pad base32 and base64 inputs when decoding
authorPádraig Brady <P@draigBrady.com>
Thu, 5 Oct 2023 16:00:51 +0000 (17:00 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 6 Oct 2023 17:21:12 +0000 (18:21 +0100)
commit378dc38f48a0cbfde3f8002d5491cc96675c904f
tree8b9acef4833a2f45108c599ff52b10977ce2f3bb
parenta2434d3e58e8ead6c4c92fd989da32fe648e1545
basenc: auto pad base32 and base64 inputs when decoding

Padding of encoded data is useful in cases where
base64 encoded data is concatenated / streamed.
I.e. where there are padding chars _within_ the stream.
In other cases padding is optional and can be inferred.
Note we continue to treat partial padding as invalid,
as that would be indicative of truncation.

* src/basenc.c (do_decode): Auto pad the end of the input.
* NEWS: Mention the change in behavior.
* tests/misc/base64.pl: Adjust to not fail for missing padding.
Addresses https://bugs.gnu.org/66265
NEWS
src/basenc.c
tests/misc/base64.pl