wintrust: Implement WVTAsn1CatNameValueEncode.
This commit is contained in:
parent
1f6a67d881
commit
74b91cb25f
|
@ -911,9 +911,29 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType,
|
||||||
LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded,
|
LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded,
|
||||||
DWORD *pcbEncoded)
|
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);
|
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 */
|
/* 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));
|
memset(&value, 0, sizeof(value));
|
||||||
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
||||||
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
||||||
todo_wine
|
|
||||||
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -619,7 +618,6 @@ static void test_encodeCatNameValue(void)
|
||||||
value.pwszTag = foo;
|
value.pwszTag = foo;
|
||||||
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
||||||
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
||||||
todo_wine
|
|
||||||
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -632,7 +630,6 @@ static void test_encodeCatNameValue(void)
|
||||||
value.fdwFlags = 0xf00dd00d;
|
value.fdwFlags = 0xf00dd00d;
|
||||||
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
||||||
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
||||||
todo_wine
|
|
||||||
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
@ -646,7 +643,6 @@ static void test_encodeCatNameValue(void)
|
||||||
value.Value.pbData = aVal;
|
value.Value.pbData = aVal;
|
||||||
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT,
|
||||||
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
(LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
|
||||||
todo_wine
|
|
||||||
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError());
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue