]> Savannah Git Hosting - gnulib.git/commit
base32, base64: disallow non-canonical encodings
authorPádraig Brady <P@draigBrady.com>
Thu, 26 Oct 2023 15:25:03 +0000 (16:25 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 27 Oct 2023 11:29:36 +0000 (12:29 +0100)
commit3f463202bdd8684c649ee9eb5d9ba867dc6e8f08
treed2efc583e2ec1a97630df1943c940a205c12bd21
parent3aac95314ccc57d53380e8c69922a6d33203bc5f
base32, base64: disallow non-canonical encodings

Unconditionally disallow encodings that don't have
appropriate zero bits before padding characters.
This handles one class of encoding variations discussed at:
https://eprint.iacr.org/2022/361.pdf
Note the other variations discussed there, due to optional
padding characters are already disallowed.

* lib/base32.c: Check that discarded bits in the encoding are zero.
* lib/base64.c: Likewise.
* tests/test-base32.c: Add test cases.
* tests/test-base64.c: Likewise.
ChangeLog
lib/base32.c
lib/base64.c
tests/test-base32.c
tests/test-base64.c