Module: wine Branch: master Commit: b7d26dc9f55e0f5bb1211d2c8f9ce0fea898221b URL: http://source.winehq.org/git/wine.git/?a=commit;h=b7d26dc9f55e0f5bb1211d2c8f...
Author: Juan Lang juan.lang@gmail.com Date: Mon Sep 8 12:45:40 2008 -0700
crypt32: Don't crash when asked to verify a signature before the content has been finalized.
---
dlls/crypt32/msg.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/dlls/crypt32/msg.c b/dlls/crypt32/msg.c index 54c5bb0..8312ff9 100644 --- a/dlls/crypt32/msg.c +++ b/dlls/crypt32/msg.c @@ -2554,6 +2554,11 @@ static BOOL CDecodeSignedMsg_VerifySignature(CDecodeMsg *msg, PCERT_INFO info) BOOL ret = FALSE; DWORD i;
+ if (!msg->u.signed_data.signerHandles) + { + SetLastError(NTE_BAD_SIGNATURE); + return FALSE; + } for (i = 0; !ret && i < msg->u.signed_data.info->cSignerInfo; i++) { PCMSG_CMS_SIGNER_INFO signerInfo = @@ -2596,6 +2601,8 @@ static BOOL CDecodeSignedMsg_VerifySignatureEx(CDecodeMsg *msg, SetLastError(ERROR_INVALID_PARAMETER); else if (para->dwSignerIndex >= msg->u.signed_data.info->cSignerInfo) SetLastError(CRYPT_E_SIGNER_NOT_FOUND); + else if (!msg->u.signed_data.signerHandles) + SetLastError(NTE_BAD_SIGNATURE); else { switch (para->dwSignerType)