Ignore base64 padding for strings that are supposed to be unpadded.

This commit is contained in:
Ralph Dolmans 2020-09-10 12:27:37 +02:00
parent 852a2e1105
commit 39f6071854

View File

@ -735,9 +735,12 @@ static int sldns_b64_pton_base(char const *src, size_t srcsize, uint8_t *target,
d = 63;
else if(base64url && d == '_')
d = 63;
else if(!base64url && d == '=')
else if(d == '=') {
if(!check_padding)
continue;
d = 64;
else continue;
} else continue;
in[incount++] = (uint8_t)d;
/* work on block of 4, unless padding is not used and there are
* less than 4 chars left */