crypt32: Only clear *pcbDecoded on error in CryptVerifyMessageSignature.

This commit is contained in:
Mikko Rasa 2010-08-18 22:32:41 +03:00 committed by Alexandre Julliard
parent 46050fb377
commit a4435e3adc
1 changed files with 4 additions and 2 deletions

View File

@ -194,13 +194,13 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
if (ppSignerCert) if (ppSignerCert)
*ppSignerCert = NULL; *ppSignerCert = NULL;
if (pcbDecoded)
*pcbDecoded = 0;
if (!pVerifyPara || if (!pVerifyPara ||
pVerifyPara->cbSize != sizeof(CRYPT_VERIFY_MESSAGE_PARA) || pVerifyPara->cbSize != sizeof(CRYPT_VERIFY_MESSAGE_PARA) ||
GET_CMSG_ENCODING_TYPE(pVerifyPara->dwMsgAndCertEncodingType) != GET_CMSG_ENCODING_TYPE(pVerifyPara->dwMsgAndCertEncodingType) !=
PKCS_7_ASN_ENCODING) PKCS_7_ASN_ENCODING)
{ {
if(pcbDecoded)
*pcbDecoded = 0;
SetLastError(E_INVALIDARG); SetLastError(E_INVALIDARG);
return FALSE; return FALSE;
} }
@ -246,6 +246,8 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
} }
CryptMsgClose(msg); CryptMsgClose(msg);
} }
if(!ret && pcbDecoded)
*pcbDecoded = 0;
TRACE("returning %d\n", ret); TRACE("returning %d\n", ret);
return ret; return ret;
} }