no trailing = for base64url

This commit is contained in:
Karel Miko 2017-02-21 01:51:12 +01:00
parent ff3a03a1d0
commit 006c601efb

View File

@ -119,7 +119,7 @@ static int _base64_decode_internal(const unsigned char *in, unsigned long inlen
if (y != 0) { if (y != 0) {
if (y == 1) return CRYPT_INVALID_PACKET; if (y == 1) return CRYPT_INVALID_PACKET;
if ((y + g) != 4 && is_strict) return CRYPT_INVALID_PACKET; if ((y + g) != 4 && is_strict && map != map_base64url) return CRYPT_INVALID_PACKET;
t = t << (6 * (4 - y)); t = t << (6 * (4 - y));
if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW; if (z + y - 1 > *outlen) return CRYPT_BUFFER_OVERFLOW;
if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255); if (y >= 2) out[z++] = (unsigned char) ((t >> 16) & 255);
@ -161,7 +161,7 @@ int base64_strict_decode(const unsigned char *in, unsigned long inlen,
#if defined(LTC_BASE64_URL) #if defined(LTC_BASE64_URL)
/** /**
base64 (URL Safe, RFC 4648 section 5) decode a block of memory Relaxed base64 (URL Safe, RFC 4648 section 5) decode a block of memory
@param in The base64 data to decode @param in The base64 data to decode
@param inlen The length of the base64 data @param inlen The length of the base64 data
@param out [out] The destination of the binary decoded data @param out [out] The destination of the binary decoded data