forked from wolfSSL/wolfssl
fix Windows function name conflict
This commit is contained in:
@ -149,7 +149,7 @@ const byte base64Encode[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
|||||||
|
|
||||||
/* make sure *i (idx) won't exceed max, store and possibly escape to out,
|
/* make sure *i (idx) won't exceed max, store and possibly escape to out,
|
||||||
* raw means use e w/o decode, 0 on success */
|
* raw means use e w/o decode, 0 on success */
|
||||||
static int Escape(int escaped, byte e, byte* out, word32* i, word32 max,
|
static int CEscape(int escaped, byte e, byte* out, word32* i, word32 max,
|
||||||
int raw)
|
int raw)
|
||||||
{
|
{
|
||||||
int doEscape = 0;
|
int doEscape = 0;
|
||||||
@ -256,19 +256,19 @@ static int DoBase64_Encode(const byte* in, word32 inLen, byte* out,
|
|||||||
byte e4 = b3 & 0x3F;
|
byte e4 = b3 & 0x3F;
|
||||||
|
|
||||||
/* store */
|
/* store */
|
||||||
ret = Escape(escaped, e1, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e1, out, &i, *outLen, 0);
|
||||||
if (ret != 0) break;
|
if (ret != 0) break;
|
||||||
ret = Escape(escaped, e2, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e2, out, &i, *outLen, 0);
|
||||||
if (ret != 0) break;
|
if (ret != 0) break;
|
||||||
ret = Escape(escaped, e3, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e3, out, &i, *outLen, 0);
|
||||||
if (ret != 0) break;
|
if (ret != 0) break;
|
||||||
ret = Escape(escaped, e4, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e4, out, &i, *outLen, 0);
|
||||||
if (ret != 0) break;
|
if (ret != 0) break;
|
||||||
|
|
||||||
inLen -= 3;
|
inLen -= 3;
|
||||||
|
|
||||||
if ((++n % (PEM_LINE_SZ / 4)) == 0 && inLen) {
|
if ((++n % (PEM_LINE_SZ / 4)) == 0 && inLen) {
|
||||||
ret = Escape(escaped, '\n', out, &i, *outLen, 1);
|
ret = CEscape(escaped, '\n', out, &i, *outLen, 1);
|
||||||
if (ret != 0) break;
|
if (ret != 0) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -284,23 +284,23 @@ static int DoBase64_Encode(const byte* in, word32 inLen, byte* out,
|
|||||||
byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
byte e2 = ((b1 & 0x3) << 4) | (b2 >> 4);
|
||||||
byte e3 = (b2 & 0xF) << 2;
|
byte e3 = (b2 & 0xF) << 2;
|
||||||
|
|
||||||
ret = Escape(escaped, e1, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e1, out, &i, *outLen, 0);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = Escape(escaped, e2, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e2, out, &i, *outLen, 0);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
/* third */
|
/* third */
|
||||||
if (twoBytes)
|
if (twoBytes)
|
||||||
ret = Escape(escaped, e3, out, &i, *outLen, 0);
|
ret = CEscape(escaped, e3, out, &i, *outLen, 0);
|
||||||
else
|
else
|
||||||
ret = Escape(escaped, '=', out, &i, *outLen, 1);
|
ret = CEscape(escaped, '=', out, &i, *outLen, 1);
|
||||||
}
|
}
|
||||||
/* fourth always pad */
|
/* fourth always pad */
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = Escape(escaped, '=', out, &i, *outLen, 1);
|
ret = CEscape(escaped, '=', out, &i, *outLen, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = Escape(escaped, '\n', out, &i, *outLen, 1);
|
ret = CEscape(escaped, '\n', out, &i, *outLen, 1);
|
||||||
|
|
||||||
if (i != outSz && escaped == 0 && ret == 0)
|
if (i != outSz && escaped == 0 && ret == 0)
|
||||||
return ASN_INPUT_E;
|
return ASN_INPUT_E;
|
||||||
|
Reference in New Issue
Block a user