mirror of
https://github.com/reactos/wine.git
synced 2025-02-15 10:29:19 +00:00
crypt32: Validate input arguments to CryptQueryObject.
This commit is contained in:
parent
351ebcae25
commit
2b384cb0e9
@ -492,6 +492,19 @@ BOOL WINAPI CryptQueryObject(DWORD dwObjectType, const void *pvObject,
|
||||
dwExpectedFormatTypeFlags, dwFlags, pdwMsgAndCertEncodingType,
|
||||
pdwContentType, pdwFormatType, phCertStore, phMsg, ppvContext);
|
||||
|
||||
if (dwObjectType != CERT_QUERY_OBJECT_BLOB &&
|
||||
dwObjectType != CERT_QUERY_OBJECT_FILE)
|
||||
{
|
||||
WARN("unsupported type %d\n", dwObjectType);
|
||||
SetLastError(E_INVALIDARG);
|
||||
return FALSE;
|
||||
}
|
||||
if (!pvObject)
|
||||
{
|
||||
WARN("missing required argument\n");
|
||||
SetLastError(E_INVALIDARG);
|
||||
return FALSE;
|
||||
}
|
||||
if (dwExpectedContentTypeFlags & unimplementedTypes)
|
||||
WARN("unimplemented for types %08x\n",
|
||||
dwExpectedContentTypeFlags & unimplementedTypes);
|
||||
|
@ -130,13 +130,11 @@ static void test_query_object(void)
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CryptQueryObject(0, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL,
|
||||
NULL);
|
||||
todo_wine
|
||||
ok(!ret && GetLastError() == E_INVALIDARG,
|
||||
"expected E_INVALIDARG, got %08x\n", GetLastError());
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB, NULL, 0, 0, 0, NULL, NULL,
|
||||
NULL, NULL, NULL, NULL);
|
||||
todo_wine
|
||||
ok(!ret && GetLastError() == E_INVALIDARG,
|
||||
"expected E_INVALIDARG, got %08x\n", GetLastError());
|
||||
/* Test with a simple cert */
|
||||
|
Loading…
x
Reference in New Issue
Block a user