]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Ignore base64 padding for strings that are supposed to be unpadded.
authorRalph Dolmans <ralph@nlnetlabs.nl>
Thu, 10 Sep 2020 10:27:37 +0000 (12:27 +0200)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Thu, 10 Sep 2020 10:27:37 +0000 (12:27 +0200)
sldns/parseutil.c

index f5d45823f158285183e37fdda15b4c306720e556..9f289d3596c39114cbd481efbb887d2fe3811288 100644 (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 */