]> git.ipfire.org Git - thirdparty/curl.git/commit
base64: base64url encoding has no padding
authorPatrick Monnerat <patrick@monnerat.net>
Tue, 12 Jul 2022 17:03:45 +0000 (19:03 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 19 Jul 2022 09:06:20 +0000 (11:06 +0200)
commitc2e72c7812e83fe59f4e84e12c7fda705b8e236b
tree331e63ee6a97d41a93e0474bda8e741bc591598f
parentdfe5a3023b76b09d1c9aa070e19cbd84d1f2dba5
base64: base64url encoding has no padding

See RFC4648 section 5 and RFC7540 section 3.2.1.

Suppress generation of '=' padding of base64url encoding. This is
accomplished by considering the string beginning at offset 64 in the
character table as the padding: this is "=" for base64, "" for base64url.

Also use strchr() to replace character search loops where possible.

Suppress erroneous comments about empty encoding results.

Adjust unit test 1302 to unpadded base64url encoding and add tests for
empty results.

Closes #9139
lib/base64.c
tests/unit/unit1302.c