Skip to content

Commit b65dd14

Browse files
committed
Hide usage of MD5 into #ifdef crypto
1 parent edd20ed commit b65dd14

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libyara/modules/elf/elf.c

+9
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ define_function(telfhash)
177177
return_string(YR_UNDEFINED);
178178
}
179179

180+
#if defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H) || \
181+
defined(HAVE_COMMONCRYPTO_COMMONCRYPTO_H)
182+
180183
define_function(import_md5)
181184
{
182185
YR_OBJECT* obj = module();
@@ -270,6 +273,8 @@ define_function(import_md5)
270273
return_string(YR_UNDEFINED);
271274
}
272275

276+
#endif // defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H)
277+
273278
int get_elf_class_data(const uint8_t* buffer, size_t buffer_length)
274279
{
275280
elf_ident_t* elf_ident;
@@ -972,7 +977,11 @@ begin_declarations
972977
end_struct_array("dynsym")
973978

974979
declare_function("telfhash", "", "s", telfhash);
980+
981+
#if defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H) || \
982+
defined(HAVE_COMMONCRYPTO_COMMONCRYPTO_H)
975983
declare_function("import_md5", "", "s", import_md5);
984+
#endif // defined(HAVE_LIBCRYPTO) || defined(HAVE_WINCRYPT_H)
976985

977986
end_declarations
978987

0 commit comments

Comments
 (0)