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.

73 lines
2.6 KiB

  1. From cc9dbd4bcd9ab3133d771c94c0466356703276a8 Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <cote2004-github@yahoo.com>
  3. Date: Fri, 8 Jun 2018 14:41:23 -0300
  4. Subject: [PATCH] Removed API deprecated by OpenSSL 1.1.0
  5. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
  6. ---
  7. main.c | 10 +++++++++-
  8. utils.c | 6 +++++-
  9. 2 files changed, 14 insertions(+), 2 deletions(-)
  10. diff --git a/main.c b/main.c
  11. index d275e6a..51bfb1d 100755
  12. --- a/main.c
  13. +++ b/main.c
  14. @@ -91,7 +91,11 @@ static void usage(void)
  15. (void) printf(" Copyright: %.1024s\n\n",NO_SPAM_STATEMENT);
  16. #ifdef HAVE_OPENSSL
  17. (void) fprintf(stdout," (Compiled with OpenSSL version: %s)\n",
  18. +# if OPENSSL_VERSION_NUMBER < 0x10100000L
  19. SSLeay_version(SSLEAY_VERSION));
  20. +# else
  21. + OpenSSL_version(OPENSSL_VERSION));
  22. +# endif
  23. #else
  24. (void) fprintf(stdout," (Not compiled with OpenSSL)\n");
  25. #endif /* HAVE_OPENSSL */
  26. @@ -1056,9 +1060,13 @@ int main(int argc,char **argv)
  27. (void) fprintf(stderr,"mailsend Version: %.1024s\n",MAILSEND_VERSION);
  28. #ifdef HAVE_OPENSSL
  29. (void) fprintf(stderr,"Compiled with OpenSSL: %s\n",
  30. +# if OPENSSL_VERSION_NUMBER < 0x10100000L
  31. SSLeay_version(SSLEAY_VERSION));
  32. +# else
  33. + OpenSSL_version(OPENSSL_VERSION));
  34. +# endif
  35. #else
  36. - (void) fprintf(stderr,"Not Compiled OpenSSL, some auth methods will be unavailable\n");
  37. + (void) fprintf(stderr,"Not Compiled with OpenSSL, some auth methods will be unavailable\n");
  38. #endif /* ! HAVE_OPENSSL */
  39. rc = 0;
  40. goto ExitProcessing;
  41. diff --git a/utils.c b/utils.c
  42. index abfb86e..02366c5 100755
  43. --- a/utils.c
  44. +++ b/utils.c
  45. @@ -440,10 +440,12 @@ void initialize_openssl(char *cipher)
  46. static const char rnd_seed[]="my huge entropy for rng.. blah";
  47. SSL_CTX *ssl_ctx=(SSL_CTX *) NULL;
  48. SSL *ssl=NULL;
  49. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  50. SSL_library_init();
  51. SSL_load_error_strings();
  52. - RAND_seed(rnd_seed,sizeof(rnd_seed));
  53. OpenSSL_add_all_algorithms();
  54. +#endif
  55. + RAND_seed(rnd_seed,sizeof(rnd_seed));
  56. ssl_ctx=SSL_CTX_new(SSLv23_client_method());
  57. if (ssl_ctx == NULL)
  58. {
  59. @@ -825,7 +827,9 @@ char *encode_cram_md5(char *challenge,char *user,char *secret)
  60. return(NULL);
  61. showVerbose("Server Challenge: %s\n",challenge);
  62. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  63. OpenSSL_add_all_digests();
  64. +#endif
  65. /* decode the challenge */
  66. data=mutils_decode_base64((unsigned char *) challenge,strlen(challenge),&data_len);
  67. --
  68. 2.19.1