From: Juan Lang Subject: Revert "crypt32: Correct CryptVerifyMessageSignature's use of pcbDecoded." Message-Id: Date: Thu, 1 Nov 2012 20:31:11 -0700 This fixes bug 31995. 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. --Juan This fixes bug 31995. 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.
--Juan
From 470e1f4e5930c1b3653e796fa35db6e24a3baaaf Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 1 Nov 2012 20:28:30 -0700 Subject: [PATCH 2/2] Revert "crypt32: Correct CryptVerifyMessageSignature's use of pcbDecoded." This reverts commit 78c901586193d20092e992a460f00f4070c67ae9. --- dlls/crypt32/message.c | 17 +++-------------- dlls/crypt32/tests/message.c | 1 + 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/dlls/crypt32/message.c b/dlls/crypt32/message.c index 8668cb1..7e163de 100644 --- a/dlls/crypt32/message.c +++ b/dlls/crypt32/message.c @@ -210,6 +210,9 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, if (msg) { ret = CryptMsgUpdate(msg, pbSignedBlob, cbSignedBlob, TRUE); + if (ret && pcbDecoded) + ret = CryptMsgGetParam(msg, CMSG_CONTENT_PARAM, 0, pbDecoded, + pcbDecoded); if (ret) { CERT_INFO *certInfo = CRYPT_GetSignerCertInfoFromMsg(msg, @@ -241,20 +244,6 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara, } 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); } if(!ret && pcbDecoded) diff --git a/dlls/crypt32/tests/message.c b/dlls/crypt32/tests/message.c index be3a03b..7e2e8aa 100644 --- a/dlls/crypt32/tests/message.c +++ b/dlls/crypt32/tests/message.c @@ -608,6 +608,7 @@ static void test_verify_message_signature(void) ret = CryptVerifyMessageSignature(¶, 0, signedWithCertWithValidPubKeyContent, sizeof(signedWithCertWithValidPubKeyContent), NULL, 0, NULL); + todo_wine ok(!ret, "Expected failure\n"); /* Finally, a message signed with a valid public key verifies successfully */ -- 1.7.7.3