diff options
author | Ladislav Zezula <ladislav.zezula@avg.com> | 2015-03-17 07:49:42 +0100 |
---|---|---|
committer | Ladislav Zezula <ladislav.zezula@avg.com> | 2015-03-17 07:49:42 +0100 |
commit | e5b9f5132a9010a36db81788e10bb1be07ccf410 (patch) | |
tree | 8cd7344b28befae3bdbe59f4ee9cc789350ea0f8 /src/SFileVerify.cpp | |
parent | c2261d51033088429ba960879dd4d9731e6f9bc1 (diff) |
+ SFileVerify: Added check whether the weak signature is not zeroed out.
+ Typos
Diffstat (limited to 'src/SFileVerify.cpp')
-rw-r--r-- | src/SFileVerify.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/SFileVerify.cpp b/src/SFileVerify.cpp index cff2a81..65bad00 100644 --- a/src/SFileVerify.cpp +++ b/src/SFileVerify.cpp @@ -442,6 +442,10 @@ static DWORD VerifyWeakSignature( int hash_idx = find_hash("md5"); int result = 0; + // The signature might be zeroed out. In that case, we ignore it + if(!IsValidSignature(pSI->Signature)) + return ERROR_WEAK_SIGNATURE_OK; + // Calculate hash of the entire archive, skipping the (signature) file if(!CalculateMpqHashMd5(ha, pSI, Md5Digest)) return ERROR_VERIFY_FAILED; @@ -746,8 +750,8 @@ bool QueryMpqSignatureInfo( if(!FileStream_Read(ha->pStream, &pSI->BeginExclude, pSI->Signature, dwFileSize)) return false; - pSI->cbSignatureSize = dwFileSize; pSI->SignatureTypes |= SIGNATURE_TYPE_WEAK; + pSI->cbSignatureSize = dwFileSize; return true; } } |