From: Torge Matthies openglfreak@googlemail.com
Signed-off-by: Torge Matthies openglfreak@googlemail.com --- dlls/wintrust/asn.c | 9 +++++---- dlls/wintrust/tests/asn.c | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/wintrust/asn.c b/dlls/wintrust/asn.c index 87deff72245..f6c4086b508 100644 --- a/dlls/wintrust/asn.c +++ b/dlls/wintrust/asn.c @@ -1878,6 +1878,8 @@ static BOOL WINAPI CRYPT_AsnDecodeOidIgnoreTag(DWORD dwCertEncodingType, } } } + else + bytesNeeded += 1; if (!pvStructInfo) *pcbStructInfo = bytesNeeded; else if (*pcbStructInfo < bytesNeeded) @@ -1888,12 +1890,13 @@ static BOOL WINAPI CRYPT_AsnDecodeOidIgnoreTag(DWORD dwCertEncodingType, } else { + LPSTR pszObjId = *(LPSTR *)pvStructInfo; + + *pszObjId = 0; if (dataLen) { const BYTE *ptr; - LPSTR pszObjId = *(LPSTR *)pvStructInfo;
- *pszObjId = 0; pszObjId += sprintf(pszObjId, "%d.%d", pbEncoded[1 + lenBytes] / 40, pbEncoded[1 + lenBytes] - (pbEncoded[1 + lenBytes] / 40) * 40); @@ -1914,8 +1917,6 @@ static BOOL WINAPI CRYPT_AsnDecodeOidIgnoreTag(DWORD dwCertEncodingType, pszObjId += sprintf(pszObjId, ".%d", val); } } - else - *(LPSTR *)pvStructInfo = NULL; *pcbStructInfo = bytesNeeded; } } diff --git a/dlls/wintrust/tests/asn.c b/dlls/wintrust/tests/asn.c index deaaf40e64b..5f75ec3298e 100644 --- a/dlls/wintrust/tests/asn.c +++ b/dlls/wintrust/tests/asn.c @@ -682,13 +682,11 @@ static void test_decodeSPCIndirectDataContent(void) if (ret) { indirectData = (SPC_INDIRECT_DATA_CONTENT *)buf; - todo_wine ok(indirectData->Data.pszObjId != NULL, "Expected non-NULL data objid\n"); if (indirectData->Data.pszObjId) ok(!strcmp(indirectData->Data.pszObjId, ""), "Expected empty data objid\n"); ok(indirectData->Data.Value.cbData == 0, "Expected no data value\n"); - todo_wine ok(indirectData->DigestAlgorithm.pszObjId != NULL, "Expected non-NULL digest algorithm objid\n"); if (indirectData->DigestAlgorithm.pszObjId)