Commit e0708d06 authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

crypt32: Fix CryptBinaryToString return value on short base64 buffer.

parent 6cbedfa6
......@@ -240,7 +240,7 @@ static BOOL BinaryToBase64A(const BYTE *pbBinary,
else
{
*pcchString = charsNeeded;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
SetLastError(ERROR_MORE_DATA);
ret = FALSE;
}
}
......@@ -460,7 +460,7 @@ static BOOL BinaryToBase64W(const BYTE *pbBinary,
else
{
*pcchString = charsNeeded;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
SetLastError(ERROR_MORE_DATA);
ret = FALSE;
}
}
......
......@@ -134,7 +134,6 @@ static void encodeAndCompareBase64_A(const BYTE *toEncode, DWORD toEncodeLen,
strLen2 = strLen - 1;
str[0] = 0x12;
ret = CryptBinaryToStringA(toEncode, toEncodeLen, format, str, &strLen2);
todo_wine
ok((!ret && GetLastError() == ERROR_MORE_DATA) || broken(ret) /* XP */, "CryptBinaryToStringA failed %d, error %d.\n",
ret, GetLastError());
ok(strLen2 == strLen || broken(strLen2 == strLen - 1), "Expected length %d, got %d\n", strLen, strLen2);
......@@ -207,7 +206,6 @@ static void encode_compare_base64_W(const BYTE *toEncode, DWORD toEncodeLen, DWO
strLen2 = strLen - 1;
strW[0] = 0x1234;
ret = CryptBinaryToStringW(toEncode, toEncodeLen, format, strW, &strLen2);
todo_wine
ok((!ret && GetLastError() == ERROR_MORE_DATA) || broken(ret) /* XP */, "CryptBinaryToStringW failed, %d, error %d\n",
ret, GetLastError());
if (headerW)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment