Hans Leidekker (@hans) commented about dlls/wintrust/crypt.c:
ALG_ID alg = CALG_SHA1;
const WCHAR *providerName = MS_DEF_PROV_W;
DWORD providerType = PROV_RSA_FULL;
DWORD hashLength = 20;
if (!hFile || !pcbHash || dwFlags) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; }
- if (*pcbHash < 20)
- {
*pcbHash = 20;
- if (ca && ca->magic == CATADMIN_MAGIC) {
alg = ca->alg;
Magic is already checked in CryptCATAdminCalcHashFromFileHandle2() so this check is redundant.