Merge pull request #29848 from poettering/base64url-too
hexdecoct: implicitly parse URL-safe base64 format, too
This commit is contained in:
@@ -553,12 +553,12 @@ int unbase64char(char c) {
|
||||
|
||||
offset += '9' - '0' + 1;
|
||||
|
||||
if (c == '+')
|
||||
if (IN_SET(c, '+', '-')) /* Support both the regular and the URL safe character set (see above) */
|
||||
return offset;
|
||||
|
||||
offset++;
|
||||
|
||||
if (c == '/')
|
||||
if (IN_SET(c, '/', '_')) /* ditto */
|
||||
return offset;
|
||||
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user