From f0cf225538f0d5dfcc932c1e75c91b4fcc53dacf Mon Sep 17 00:00:00 2001 From: "Victor M. Alvarez" Date: Tue, 7 May 2024 13:06:10 +0200 Subject: [PATCH] Fix issue introduced in 8501962. `authenticode->verify_flags` are not really bit flags, they are more like error codes. --- libyara/modules/pe/pe.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libyara/modules/pe/pe.c b/libyara/modules/pe/pe.c index 9511787721..23a7292f91 100644 --- a/libyara/modules/pe/pe.c +++ b/libyara/modules/pe/pe.c @@ -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;