Skip to content

Commit

Permalink
Fix issue introduced in 8501962.
Browse files Browse the repository at this point in the history
`authenticode->verify_flags` are not really bit flags, they are more like error codes.
  • Loading branch information
plusvic committed May 7, 2024
1 parent 8501962 commit f0cf225
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libyara/modules/pe/pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,19 +1759,19 @@ void _process_authenticode(
{
const Authenticode* authenticode = auth_array->signatures[i];

if (authenticode->verify_flags & AUTHENTICODE_VFY_CANT_PARSE)
if (authenticode->verify_flags == AUTHENTICODE_VFY_CANT_PARSE)
continue;

if (authenticode->verify_flags & AUTHENTICODE_VFY_WRONG_PKCS7_TYPE)
if (authenticode->verify_flags == AUTHENTICODE_VFY_WRONG_PKCS7_TYPE)
continue;

if (authenticode->verify_flags & AUTHENTICODE_VFY_NO_SIGNER_INFO)
if (authenticode->verify_flags == AUTHENTICODE_VFY_NO_SIGNER_INFO)
continue;

if (authenticode->verify_flags & AUTHENTICODE_VFY_NO_SIGNER_CERT)
if (authenticode->verify_flags == AUTHENTICODE_VFY_NO_SIGNER_CERT)
continue;

if (authenticode->verify_flags & AUTHENTICODE_VFY_INTERNAL_ERROR)
if (authenticode->verify_flags == AUTHENTICODE_VFY_INTERNAL_ERROR)
continue;

bool verified = authenticode->verify_flags == AUTHENTICODE_VFY_VALID;
Expand Down

0 comments on commit f0cf225

Please sign in to comment.