Skip to content

Commit

Permalink
Hide usage of MD5 into #ifdef crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
HoundThe committed Jan 22, 2022
1 parent edd20ed commit b65dd14
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libyara/modules/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ define_function(telfhash)
return_string(YR_UNDEFINED);
}

#if defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H) || \
defined(HAVE_COMMONCRYPTO_COMMONCRYPTO_H)

define_function(import_md5)
{
YR_OBJECT* obj = module();
Expand Down Expand Up @@ -270,6 +273,8 @@ define_function(import_md5)
return_string(YR_UNDEFINED);
}

#endif // defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H)

int get_elf_class_data(const uint8_t* buffer, size_t buffer_length)
{
elf_ident_t* elf_ident;
Expand Down Expand Up @@ -972,7 +977,11 @@ begin_declarations
end_struct_array("dynsym")

declare_function("telfhash", "", "s", telfhash);

#if defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H) || \
defined(HAVE_COMMONCRYPTO_COMMONCRYPTO_H)
declare_function("import_md5", "", "s", import_md5);
#endif // defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H)

end_declarations

Expand Down

0 comments on commit b65dd14

Please sign in to comment.