Windows: Use only SHA256 certificate for code signature verification since SHA1 certificate is not used anymore.

This commit is contained in:
Mounir IDRASSI 2021-07-14 13:23:40 +02:00
parent 94cd0a477f
commit d6402ac146
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F

View File

@ -398,15 +398,6 @@ static WTHELPERPROVDATAFROMSTATEDATA WTHelperProvDataFromStateDataFn = NULL;
static WTHELPERGETPROVSIGNERFROMCHAIN WTHelperGetProvSignerFromChainFn = NULL;
static WTHELPERGETPROVCERTFROMCHAIN WTHelperGetProvCertFromChainFn = NULL;
static unsigned char gpbSha1CodeSignCertFingerprint[64] = {
0x97, 0xE3, 0x36, 0xE0, 0x45, 0x21, 0xE9, 0x8A, 0xA7, 0xEA, 0xE8, 0x68,
0x4A, 0x56, 0x02, 0xB2, 0xE7, 0x63, 0x59, 0x3A, 0x37, 0x03, 0x64, 0xC3,
0x7D, 0xBF, 0xF8, 0x19, 0xDB, 0x39, 0x57, 0x41, 0x55, 0x00, 0x9C, 0xBE,
0xFE, 0xA3, 0xBC, 0x0F, 0xE3, 0xD8, 0x34, 0x2D, 0x2F, 0xB4, 0x80, 0xBE,
0xDD, 0xEA, 0xA7, 0xDB, 0xAD, 0x53, 0x07, 0x71, 0x1A, 0x12, 0x42, 0xB4,
0xE9, 0x65, 0xA5, 0x61
};
static unsigned char gpbSha256CodeSignCertFingerprint[64] = {
0x88, 0x60, 0xC4, 0x26, 0x6D, 0x42, 0x59, 0x1B, 0xDF, 0x89, 0x0F, 0x1A,
0x2F, 0x70, 0x8D, 0xBB, 0xC0, 0xF0, 0x03, 0x1F, 0x37, 0x11, 0xF9, 0x24,
@ -14114,9 +14105,7 @@ BOOL VerifyModuleSignature (const wchar_t* path)
BYTE hashVal[64];
sha512 (hashVal, pProviderCert->pCert->pbCertEncoded, pProviderCert->pCert->cbCertEncoded);
if ( (0 == memcmp (hashVal, gpbSha1CodeSignCertFingerprint, 64))
|| (0 == memcmp (hashVal, gpbSha256CodeSignCertFingerprint, 64))
)
if (0 == memcmp (hashVal, gpbSha256CodeSignCertFingerprint, 64))
{
bResult = TRUE;
}