Commit a35d2b17 authored by Torge Matthies's avatar Torge Matthies Committed by Alexandre Julliard

wintrust: Fix segfault in CRYPT_AsnEncodeAttributeTypeValue.

parent 2f2fbefb
......@@ -681,7 +681,7 @@ static BOOL WINAPI CRYPT_AsnEncodeAttributeTypeValue(DWORD dwCertEncodingType,
{
const CRYPT_ATTRIBUTE_TYPE_VALUE *typeValue = pvStructInfo;
struct AsnEncodeSequenceItem items[] = {
{ &typeValue->pszObjId, CRYPT_AsnEncodeOid, 0 },
{ typeValue->pszObjId, CRYPT_AsnEncodeOid, 0 },
{ &typeValue->Value, CRYPT_CopyEncodedBlob, 0 },
};
......
......@@ -575,11 +575,9 @@ static void test_encodeSPCIndirectDataContent(void)
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_INDIRECT_DATA_CONTENT_STRUCT,
&indirectData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
todo_wine
ok(size == sizeof(emptyIndirectData), "Unexpected size %ld\n", size);
if (size == sizeof(emptyIndirectData))
todo_wine
......@@ -592,11 +590,9 @@ static void test_encodeSPCIndirectDataContent(void)
indirectData.Digest.pbData = fakeDigest;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_INDIRECT_DATA_CONTENT_STRUCT,
&indirectData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
todo_wine
ok(size == sizeof(spcidcWithOnlyDigest), "Unexpected size %ld\n", size);
if (size == sizeof(spcidcWithOnlyDigest))
todo_wine
......@@ -608,7 +604,6 @@ static void test_encodeSPCIndirectDataContent(void)
indirectData.DigestAlgorithm.pszObjId = szOID_OIWSEC_sha1_;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_INDIRECT_DATA_CONTENT_STRUCT,
&indirectData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
......@@ -626,7 +621,6 @@ static void test_encodeSPCIndirectDataContent(void)
indirectData.DigestAlgorithm.Parameters.pbData = parameters;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_INDIRECT_DATA_CONTENT_STRUCT,
&indirectData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
......@@ -643,7 +637,6 @@ static void test_encodeSPCIndirectDataContent(void)
indirectData.Data.pszObjId = SPC_PE_IMAGE_DATA_OBJID_;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_INDIRECT_DATA_CONTENT_STRUCT,
&indirectData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08lx\n", GetLastError());
if (ret)
{
......@@ -661,7 +654,6 @@ static void test_encodeSPCIndirectDataContent(void)
indirectData.Data.Value.pbData = (void*)emptySequence;
ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, SPC_INDIRECT_DATA_CONTENT_STRUCT,
&indirectData, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size);
todo_wine
ok(ret, "CryptEncodeObjectEx failed: %08lx\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