You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

  1. --- a/src/plugins/crypto/openssl_operations.c
  2. +++ b/src/plugins/crypto/openssl_operations.c
  3. @@ -25,6 +25,10 @@
  4. #include <stdlib.h>
  5. #include <string.h>
  6. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  7. +#define EVP_CIPHER_CTX_reset EVP_CIPHER_CTX_cleanup
  8. +#endif
  9. +
  10. #define KEY_BUFFER_SIZE (ELEKTRA_CRYPTO_SSL_KEYSIZE + ELEKTRA_CRYPTO_SSL_BLOCKSIZE)
  11. /*
  12. @@ -144,8 +148,10 @@ int elektraCryptoOpenSSLInit (Key * errorKey ELEKTRA_UNUSED)
  13. // initialize OpenSSL according to
  14. // https://wiki.openssl.org/index.php/Library_Initialization
  15. pthread_mutex_lock (&mutex_ssl);
  16. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  17. OpenSSL_add_all_algorithms ();
  18. ERR_load_crypto_strings ();
  19. +#endif
  20. pthread_mutex_unlock (&mutex_ssl);
  21. return 1;
  22. }
  23. @@ -246,8 +252,8 @@ void elektraCryptoOpenSSLHandleDestroy (elektraCryptoHandle * handle)
  24. if (handle)
  25. {
  26. pthread_mutex_lock (&mutex_ssl);
  27. - EVP_CIPHER_CTX_cleanup (handle->encrypt);
  28. - EVP_CIPHER_CTX_cleanup (handle->decrypt);
  29. + EVP_CIPHER_CTX_reset (handle->encrypt);
  30. + EVP_CIPHER_CTX_reset (handle->decrypt);
  31. EVP_CIPHER_CTX_free (handle->encrypt);
  32. EVP_CIPHER_CTX_free (handle->decrypt);
  33. pthread_mutex_unlock (&mutex_ssl);