Commit 1040e415 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Revert "crypt32: Correct CryptVerifyMessageSignature's use of pcbDecoded.".

This reverts commit 78c90158. The comments in the tests indicate that the tests are a little funny anyway, so they clearly weren't enough justification for the change introduced here.
parent 373e472d
...@@ -210,6 +210,9 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, ...@@ -210,6 +210,9 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
if (msg) if (msg)
{ {
ret = CryptMsgUpdate(msg, pbSignedBlob, cbSignedBlob, TRUE); ret = CryptMsgUpdate(msg, pbSignedBlob, cbSignedBlob, TRUE);
if (ret && pcbDecoded)
ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, pbDecoded,
pcbDecoded);
if (ret) if (ret)
{ {
CERT_INFO *certInfo = CRYPT_GetSignerCertInfoFromMsg(msg, CERT_INFO *certInfo = CRYPT_GetSignerCertInfoFromMsg(msg,
...@@ -241,20 +244,6 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, ...@@ -241,20 +244,6 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
} }
CryptMemFree(certInfo); CryptMemFree(certInfo);
} }
if (ret)
{
/* The caller is expected to pass a valid pointer to pcbDecoded
* when the message verifies successfully.
*/
if (pcbDecoded)
ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, pbDecoded,
pcbDecoded);
else
{
SetLastError(CRYPT_E_NOT_FOUND);
ret = FALSE;
}
}
CryptMsgClose(msg); CryptMsgClose(msg);
} }
if(!ret && pcbDecoded) if(!ret && pcbDecoded)
......
...@@ -608,6 +608,7 @@ static void test_verify_message_signature(void) ...@@ -608,6 +608,7 @@ static void test_verify_message_signature(void)
ret = CryptVerifyMessageSignature(&para, 0, ret = CryptVerifyMessageSignature(&para, 0,
signedWithCertWithValidPubKeyContent, signedWithCertWithValidPubKeyContent,
sizeof(signedWithCertWithValidPubKeyContent), NULL, 0, NULL); sizeof(signedWithCertWithValidPubKeyContent), NULL, 0, NULL);
todo_wine
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
/* Finally, a message signed with a valid public key verifies successfully /* Finally, a message signed with a valid public key verifies successfully
*/ */
......
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