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.

49 lines
1.4 KiB

  1. From 652dd89d297df2dbf7fc7a235d5305b5fc945e2f Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Sun, 25 Nov 2018 19:09:33 -0800
  4. Subject: [PATCH] Fix compilation under OpenSSL 1.1 without deprecated APIs
  5. ---
  6. ssl.c | 4 ++++
  7. ssl.h | 2 ++
  8. 2 files changed, 6 insertions(+)
  9. diff --git a/ssl.c b/ssl.c
  10. index 6c67879..1a222bb 100644
  11. --- a/ssl.c
  12. +++ b/ssl.c
  13. @@ -359,7 +359,9 @@ static SSL_CTX *ssl_create_context(char *keyfile, char *certfile,
  14. debug("continuing anyway...");
  15. }
  16. }
  17. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  18. SSL_CTX_set_tmp_rsa_callback(ssl_context, ssl_temp_rsa_cb);
  19. +#endif
  20. SSL_CTX_set_info_callback(ssl_context, ssl_info_cb);
  21. SSL_CTX_set_tlsext_status_cb(ssl_context, ssl_stapling_cb);
  22. SSL_CTX_set_tlsext_servername_callback(ssl_context, ssl_sni_cb);
  23. @@ -405,8 +407,10 @@ static SSL_CTX *ssl_create_context(char *keyfile, char *certfile,
  24. int ssl_init(void)
  25. {
  26. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  27. SSL_load_error_strings();
  28. SSLeay_add_ssl_algorithms();
  29. +#endif
  30. ssl_context = ssl_create_context(keyfile, certfile, cacert_dir, cacert_file);
  31. if (ssl_context == NULL) {
  32. error("Unable to create default context");
  33. diff --git a/ssl.h b/ssl.h
  34. index a0dcd18..b63161e 100644
  35. --- a/ssl.h
  36. +++ b/ssl.h
  37. @@ -1,6 +1,8 @@
  38. #ifdef HAVE_LIBSSL
  39. #include <openssl/ssl.h>
  40. #include <openssl/err.h>
  41. +#include <openssl/bn.h>
  42. +#include <openssl/rsa.h>
  43. #define SRV_SSL_V23 0
  44. #define SRV_SSL_V2 1