Merge pull request #7334 from neheb/monit
[feed/packages.git] / admin / ipmitool / patches / 0005-ipmitool-Fix-compile-with-deprecated-APIs-disabled.patch
1 From cf39da53236abf02d39c6a98a645488933f3e861 Mon Sep 17 00:00:00 2001
2 From: Rosen Penev <rosenp@gmail.com>
3 Date: Tue, 21 Aug 2018 19:29:07 -0700
4 Subject: [PATCH] ipmitool: Fix compile with deprecated APIs disabled.
5
6 From the man page:
7
8 EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result,
9 EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared.
10 EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().
11
12 Signed-off-by: Rosen Penev <rosenp@gmail.com>
13 ---
14 src/plugins/lanplus/lanplus_crypt_impl.c | 8 ++++++++
15 1 file changed, 8 insertions(+)
16
17 diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
18 index 9652a5e..e94401e 100644
19 --- a/src/plugins/lanplus/lanplus_crypt_impl.c
20 +++ b/src/plugins/lanplus/lanplus_crypt_impl.c
21 @@ -183,7 +183,11 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
22 lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
23 return;
24 }
25 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
26 EVP_CIPHER_CTX_init(ctx);
27 +#else
28 + EVP_CIPHER_CTX_reset(ctx);
29 +#endif
30 EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
31 EVP_CIPHER_CTX_set_padding(ctx, 0);
32
33 @@ -262,7 +266,11 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
34 lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
35 return;
36 }
37 +#if OPENSSL_VERSION_NUMBER < 0x10100000L
38 EVP_CIPHER_CTX_init(ctx);
39 +#else
40 + EVP_CIPHER_CTX_reset(ctx);
41 +#endif
42 EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
43 EVP_CIPHER_CTX_set_padding(ctx, 0);
44
45 --
46 2.7.4
47