From b65dd145ea7dbf0734df76edea74d13e59ca71b3 Mon Sep 17 00:00:00 2001 From: houndthe Date: Sat, 22 Jan 2022 04:06:53 +0100 Subject: [PATCH] Hide usage of MD5 into #ifdef crypto --- libyara/modules/elf/elf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libyara/modules/elf/elf.c b/libyara/modules/elf/elf.c index 4a7b305ff9..4731147f6f 100644 --- a/libyara/modules/elf/elf.c +++ b/libyara/modules/elf/elf.c @@ -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(); @@ -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; @@ -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