Hi Qifan,
Thanks for reporting that issue.
I can reproduce this on master. The decoder sets "end" at the first "="
and never looks at it again, so later data and later "=" all pass
0001 raises an error for anything but whitespace after the padding, the
same rule base32hex already has. 0002 adds tests. 0003 fixes the two
copies of this code, pg_b64_decode() in src/common and the armor decoder
in pgcrypto. dearmor() shows the same bug when the CRC matches.
This rejects input that used to pass, so I am not sure about the back
branches. I would leave that to the committer.
Thanks,
Shihao