secur32: Fix wrong bit shift in the base64 encoder.
Thanks to Juan Lang for catching this one.
This commit is contained in:
parent
63307241dd
commit
f543aea5e3
|
@ -72,7 +72,7 @@ SECURITY_STATUS encodeBase64(PBYTE in_buf, int in_len, char* out_buf,
|
||||||
out_buf[i + 1] = b64[ ((d[0] << 4) & 0x30) | (d[1] >> 4 & 0x0f)];
|
out_buf[i + 1] = b64[ ((d[0] << 4) & 0x30) | (d[1] >> 4 & 0x0f)];
|
||||||
/* third char is the last 4 bits of the second byte padded with
|
/* third char is the last 4 bits of the second byte padded with
|
||||||
* two zeroes */
|
* two zeroes */
|
||||||
out_buf[i + 2] = b64[ ((d[1] >> 4) & 0x3c) ];
|
out_buf[i + 2] = b64[ ((d[1] << 2) & 0x3c) ];
|
||||||
/* fourth char is a = to indicate one byte of padding */
|
/* fourth char is a = to indicate one byte of padding */
|
||||||
out_buf[i + 3] = '=';
|
out_buf[i + 3] = '=';
|
||||||
out_buf[i + 4] = 0;
|
out_buf[i + 4] = 0;
|
||||||
|
|
Loading…
Reference in New Issue