Commit 3f463202bdd8684c649ee9eb5d9ba867dc6e8f08

Pádraig Brady 2023-10-26T16:25:03

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.