yara-rust icon indicating copy to clipboard operation
yara-rust copied to clipboard

OpenSSL will always be included, even if `module-hash` is not enabled

Open nbigaouette opened this issue 2 years ago • 1 comments

The module-hash cargo feature controls if the hash module in yara is compiled or not. That module exposes hashing functionality through OpenSSL.

For a project I do not need hashing functionality and I don't want to include OpenSSL, so I disable the yara-rusts module-hash cargo feature, but then building yara fails with the error:

error: could not find native static library `ssl`, perhaps an -L flag is missing?

After investigation, it seems that we need to also set the environment variable YARA_CRYPTO_LIB=disable so that yara-sys doesn't include it.

Could it be possible to automatically set YARA_CRYPTO_LIB=disable when the module-hash cargo feature is not enabled? That would require a build.rs for yara-rust with that logic.

nbigaouette avatar Sep 08 '23 15:09 nbigaouette

@nbigaouette hello! Not only module-hash requires OpenSSL. For example some part of pe module also required OpenSSL.

ikrivosheev avatar Sep 08 '23 15:09 ikrivosheev