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.

66 lines
2.4 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. --- a/main.c
  11. +++ b/main.c
  12. @@ -91,7 +91,11 @@ static void usage(void)
  13. (void) printf(" Copyright: %.1024s\n\n",NO_SPAM_STATEMENT);
  14. #ifdef HAVE_OPENSSL
  15. (void) fprintf(stdout," (Compiled with OpenSSL version: %s)\n",
  16. +# if OPENSSL_VERSION_NUMBER < 0x10100000L
  17. SSLeay_version(SSLEAY_VERSION));
  18. +# else
  19. + OpenSSL_version(OPENSSL_VERSION));
  20. +# endif
  21. #else
  22. (void) fprintf(stdout," (Not compiled with OpenSSL)\n");
  23. #endif /* HAVE_OPENSSL */
  24. @@ -1056,9 +1060,13 @@ int main(int argc,char **argv)
  25. (void) fprintf(stderr,"mailsend Version: %.1024s\n",MAILSEND_VERSION);
  26. #ifdef HAVE_OPENSSL
  27. (void) fprintf(stderr,"Compiled with OpenSSL: %s\n",
  28. +# if OPENSSL_VERSION_NUMBER < 0x10100000L
  29. SSLeay_version(SSLEAY_VERSION));
  30. +# else
  31. + OpenSSL_version(OPENSSL_VERSION));
  32. +# endif
  33. #else
  34. - (void) fprintf(stderr,"Not Compiled OpenSSL, some auth methods will be unavailable\n");
  35. + (void) fprintf(stderr,"Not Compiled with OpenSSL, some auth methods will be unavailable\n");
  36. #endif /* ! HAVE_OPENSSL */
  37. rc = 0;
  38. goto ExitProcessing;
  39. --- a/utils.c
  40. +++ b/utils.c
  41. @@ -440,10 +440,12 @@ void initialize_openssl(char *cipher)
  42. static const char rnd_seed[]="my huge entropy for rng.. blah";
  43. SSL_CTX *ssl_ctx=(SSL_CTX *) NULL;
  44. SSL *ssl=NULL;
  45. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  46. SSL_library_init();
  47. SSL_load_error_strings();
  48. - RAND_seed(rnd_seed,sizeof(rnd_seed));
  49. OpenSSL_add_all_algorithms();
  50. +#endif
  51. + RAND_seed(rnd_seed,sizeof(rnd_seed));
  52. ssl_ctx=SSL_CTX_new(SSLv23_client_method());
  53. if (ssl_ctx == NULL)
  54. {
  55. @@ -825,7 +827,9 @@ char *encode_cram_md5(char *challenge,ch
  56. return(NULL);
  57. showVerbose("Server Challenge: %s\n",challenge);
  58. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  59. OpenSSL_add_all_digests();
  60. +#endif
  61. /* decode the challenge */
  62. data=mutils_decode_base64((unsigned char *) challenge,strlen(challenge),&data_len);