mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-07-01 05:11:13 +02:00
ima-evm-utils: limit OPENSSL_init_crypto calls
OPENSSL_init_crypto() was introduced in version 1.1. When using an
older version of openssl, don't call OPENSSL_init_crypto. Partially
revert commit 782224f33c
("ima-evm-utils: Rework openssl init").
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
@ -979,7 +979,14 @@ int sign_hash(const char *hashalgo, const unsigned char *hash, int size, const c
|
||||
|
||||
static void libinit()
|
||||
{
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000
|
||||
OpenSSL_add_all_algorithms();
|
||||
OPENSSL_add_all_algorithms_conf();
|
||||
#else
|
||||
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS |
|
||||
OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
|
||||
ERR_load_crypto_strings();
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user