0006-lanplus-Fix-compile-with-deprecated-APIs-disabled.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From fc2136969adfb926eed610b8ed0a74b2030b48ed 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] lanplus: Fix compile with deprecated APIs disabled.
  5. From the man page:
  6. EVP_CIPHER_CTX was made opaque in OpenSSL 1.1.0. As a result,
  7. EVP_CIPHER_CTX_reset() appeared and EVP_CIPHER_CTX_cleanup() disappeared.
  8. EVP_CIPHER_CTX_init() remains as an alias for EVP_CIPHER_CTX_reset().
  9. Upstream: https://github.com/ipmitool/ipmitool/commit/a8862d7508fb138b1c286eea958700cca63c9476
  10. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  11. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
  12. ---
  13. src/plugins/lanplus/lanplus_crypt_impl.c | 8 ++++++++
  14. 1 file changed, 8 insertions(+)
  15. diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
  16. index 9652a5e..e94401e 100644
  17. --- a/src/plugins/lanplus/lanplus_crypt_impl.c
  18. +++ b/src/plugins/lanplus/lanplus_crypt_impl.c
  19. @@ -183,7 +183,11 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
  20. lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
  21. return;
  22. }
  23. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  24. EVP_CIPHER_CTX_init(ctx);
  25. +#else
  26. + EVP_CIPHER_CTX_reset(ctx);
  27. +#endif
  28. EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
  29. EVP_CIPHER_CTX_set_padding(ctx, 0);
  30. @@ -262,7 +266,11 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
  31. lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
  32. return;
  33. }
  34. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  35. EVP_CIPHER_CTX_init(ctx);
  36. +#else
  37. + EVP_CIPHER_CTX_reset(ctx);
  38. +#endif
  39. EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
  40. EVP_CIPHER_CTX_set_padding(ctx, 0);
  41. --
  42. 1.9.1