// ntfill.h
// rev
typedef // routine: CiVerifyHashInCatalog (before 6.1.7601.18519)
_Function_class_(CI_VERIFY_HASH_IN_CATALOG_LEGACY)
_IRQL_requires_max_(PASSIVE_LEVEL)
_Must_inspect_result_
NTSTATUS
NTAPI
CI_VERIFY_HASH_IN_CATALOG_LEGACY(
_In_bytecount_(MINCRYPT_SHA1_HASH_LEN) PBYTE Hash,
_In_ ULONG ReloadCatalogs,
_In_ ULONG SecureProcess,
_In_ ULONG AcceptRoots,
_Inout_opt_ PMINCRYPT_POLICY_INFO PolicyInfo,
_Out_opt_ PUNICODE_STRING CatalogName, // RtlFreeUnicodeString
_Out_opt_ PLARGE_INTEGER SigningTime,
_Inout_opt_ PMINCRYPT_POLICY_INFO TimeStampPolicyInfo
);
View code on GitHub// ntfill.h
// rev
typedef // routine: CiVerifyHashInCatalog (6.1.7601.18519 and later)
_Function_class_(CI_VERIFY_HASH_IN_CATALOG)
_IRQL_requires_max_(PASSIVE_LEVEL)
_Must_inspect_result_
NTSTATUS
NTAPI
CI_VERIFY_HASH_IN_CATALOG(
_In_bytecount_(HashSize) PBYTE Hash,
_In_ ULONG HashSize,
_In_ ALG_ID AlgorithmId,
_In_ ULONG ReloadCatalogs,
_In_ ULONG SecureProcess,
_In_ ULONG AcceptRoots,
_Inout_opt_ PMINCRYPT_POLICY_INFO PolicyInfo,
_Out_opt_ PUNICODE_STRING CatalogName, // RtlFreeUnicodeString
_Out_opt_ PLARGE_INTEGER SigningTime,
_Inout_opt_ PMINCRYPT_POLICY_INFO TimeStampPolicyInfo
);
View code on GitHubFor an input Authenticode file digest, validates that the digest is contained within a verified system catalog. Optionally returns information about the catalog.
Hash - a pointer to the file digest to look up in the catalogs.HashSize - the size of the digest in bytes.AlgorithmId - the algorithm used to compute the digest, such as CALG_SHA1 or CALG_SHA_256.ReloadCatalogs - controls whether the Code Integrity subsystem rescans the catalog store before performing the lookup. The precise semantics of non-zero values are not publicly documented.SecureProcess - selects a stricter verification policy when non-zero. The precise semantics are not publicly documented.AcceptRoots - additional bits controlling which root authorities are acceptable for the catalog signer. The precise encoding is not publicly documented; typical values are drawn from the MINCRYPT_POLICY_*_ROOT flags.PolicyInfo - an optional pointer to a MINCRYPT_POLICY_INFO structure that receives information about the catalog signer. The caller must release it with CiFreePolicyInfo when it is no longer needed.CatalogName - an optional pointer to a UNICODE_STRING that receives the name of the catalog file that contained the matching hash. The buffer is allocated by the callee and must be released with RtlFreeUnicodeString.SigningTime - an optional pointer that receives the time of signing, when available.TimeStampPolicyInfo - an optional pointer to a MINCRYPT_POLICY_INFO structure that receives information about the timestamping authority, with the same ownership and release rules as PolicyInfo.This function is exported from ci.dll. The pedigest project demonstrates using it as a fallback when a PE image does not carry an embedded signature that CiCheckSignedFile can verify.
Prior to build 6.1.7601.18519, the function had a legacy prototype that only accepted SHA-1 hashes and did not take explicit size and algorithm parameters.
The meaning of the ReloadCatalogs, SecureProcess, and AcceptRoots parameters described above is inferred from their names; they are not covered by any public documentation known to us.