Commit 74b91cb2 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Implement WVTAsn1CatNameValueEncode.

parent 1f6a67d8
......@@ -911,9 +911,29 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded,
DWORD *pcbEncoded)
{
FIXME("(0x%08x, %s, %p, %p, %p): stub\n", dwCertEncodingType,
BOOL ret = FALSE;
TRACE("(0x%08x, %s, %p, %p, %p)\n", dwCertEncodingType,
debugstr_a(lpszStructType), pvStructInfo, pbEncoded, pcbEncoded);
return FALSE;
__TRY
{
const CAT_NAMEVALUE *value = (const CAT_NAMEVALUE *)pvStructInfo;
struct AsnEncodeSequenceItem items[] = {
{ value->pwszTag, CRYPT_AsnEncodeBMPString, 0 },
{ &value->fdwFlags, CRYPT_AsnEncodeInt, 0 },
{ &value->Value, CRYPT_AsnEncodeOctets, 0 },
};
ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING,
items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded);
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
}
__ENDTRY
return ret;
}
/* Gets the number of length bytes from the given (leading) length byte */
......
......@@ -607,7 +607,6 @@ static void test_encodeCatNameValue(void)
memset(&value, 0, sizeof(value));
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
if (ret)
{
......@@ -619,7 +618,6 @@ static void test_encodeCatNameValue(void)
value.pwszTag = foo;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
if (ret)
{
......@@ -632,7 +630,6 @@ static void test_encodeCatNameValue(void)
value.fdwFlags = 0xf00dd00d;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
if (ret)
{
......@@ -646,7 +643,6 @@ static void test_encodeCatNameValue(void)
value.Value.pbData = aVal;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
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