Commit 36d01401 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Implement WVTAsn1CatNameValueDecode.

parent e009cd90
...@@ -2095,7 +2095,33 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType, ...@@ -2095,7 +2095,33 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
void *pvStructInfo, DWORD *pcbStructInfo) void *pvStructInfo, DWORD *pcbStructInfo)
{ {
FIXME("(%p, %d, %08x, %p, %d): stub\n", pbEncoded, cbEncoded, dwFlags, BOOL ret = FALSE;
TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags,
pvStructInfo, *pcbStructInfo); pvStructInfo, *pcbStructInfo);
return FALSE;
__TRY
{
struct AsnDecodeSequenceItem items[] = {
{ ASN_BMPSTRING, offsetof(CAT_NAMEVALUE, pwszTag),
CRYPT_AsnDecodeBMPString, sizeof(LPWSTR), FALSE, TRUE,
offsetof(CAT_NAMEVALUE, pwszTag), 0 },
{ ASN_INTEGER, offsetof(CAT_NAMEVALUE, fdwFlags),
CRYPT_AsnDecodeInt, sizeof(DWORD), FALSE, FALSE, 0, 0 },
{ ASN_OCTETSTRING, offsetof(CAT_NAMEVALUE, Value),
CRYPT_AsnDecodeOctets, sizeof(CRYPT_DER_BLOB), FALSE, TRUE,
offsetof(CAT_NAMEVALUE, Value.pbData), 0 },
};
ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items,
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
}
__ENDTRY
TRACE("returning %d\n", ret);
return ret;
} }
...@@ -663,7 +663,6 @@ static void test_decodeCatNameValue(void) ...@@ -663,7 +663,6 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
emptyCatNameValue, sizeof(emptyCatNameValue), emptyCatNameValue, sizeof(emptyCatNameValue),
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
todo_wine
ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
if (ret) if (ret)
{ {
...@@ -678,7 +677,6 @@ static void test_decodeCatNameValue(void) ...@@ -678,7 +677,6 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
catNameValueWithTag, sizeof(catNameValueWithTag), catNameValueWithTag, sizeof(catNameValueWithTag),
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
todo_wine
ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
if (ret) if (ret)
{ {
...@@ -694,7 +692,6 @@ static void test_decodeCatNameValue(void) ...@@ -694,7 +692,6 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
catNameValueWithFlags, sizeof(catNameValueWithFlags), catNameValueWithFlags, sizeof(catNameValueWithFlags),
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
todo_wine
ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
if (ret) if (ret)
{ {
...@@ -709,7 +706,6 @@ static void test_decodeCatNameValue(void) ...@@ -709,7 +706,6 @@ static void test_decodeCatNameValue(void)
ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
catNameValueWithValue, sizeof(catNameValueWithValue), catNameValueWithValue, sizeof(catNameValueWithValue),
CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size);
todo_wine
ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError());
if (ret) if (ret)
{ {
......
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