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.

65 lines
2.3 KiB

  1. --- a/src/lftp_ssl.cc
  2. +++ b/src/lftp_ssl.cc
  3. @@ -34,6 +34,9 @@
  4. #include "misc.h"
  5. #include "network.h"
  6. #include "buffer.h"
  7. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  8. +#define X509_STORE_CTX_get_by_subject X509_STORE_get_by_subject
  9. +#endif
  10. extern "C" {
  11. #include "c-ctype.h"
  12. #include "quotearg.h"
  13. @@ -833,11 +836,13 @@ lftp_ssl_openssl_instance::lftp_ssl_openssl_instance()
  14. if(RAND_load_file(file,-1) && RAND_status()!=0)
  15. atexit(lftp_ssl_write_rnd);
  16. -#if SSLEAY_VERSION_NUMBER < 0x0800
  17. +#if OPENSSL_VERSION_NUMBER < 0x0800
  18. ssl_ctx=SSL_CTX_new();
  19. X509_set_default_verify_paths(ssl_ctx->cert);
  20. #else
  21. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  22. SSLeay_add_ssl_algorithms();
  23. +#endif
  24. ssl_ctx=SSL_CTX_new(SSLv23_client_method());
  25. long options=SSL_OP_ALL|SSL_OP_NO_TICKET|SSL_OP_NO_SSLv2;
  26. const char *priority=ResMgr::Query("ssl:priority", 0);
  27. @@ -1075,7 +1080,9 @@ void lftp_ssl_openssl::copy_sid(const lftp_ssl_openssl *o)
  28. const char *lftp_ssl_openssl::strerror()
  29. {
  30. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  31. SSL_load_error_strings();
  32. +#endif
  33. int error=ERR_get_error();
  34. const char *ssl_error=0;
  35. if(ERR_GET_LIB(error)==ERR_LIB_SSL)
  36. @@ -1154,7 +1161,7 @@ int lftp_ssl_openssl::verify_crl(X509_STORE_CTX *ctx)
  37. obj = X509_OBJECT_new();
  38. store_ctx = X509_STORE_CTX_new();
  39. X509_STORE_CTX_init(store_ctx, instance->crl_store, NULL, NULL);
  40. - rc = X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, subject, obj);
  41. + rc = X509_STORE_CTX_get_by_subject(store_ctx, X509_LU_CRL, subject, obj);
  42. X509_STORE_CTX_free(store_ctx); store_ctx=0;
  43. crl = X509_OBJECT_get0_X509_CRL(obj);
  44. if (rc > 0 && crl != NULL) {
  45. @@ -1194,7 +1201,7 @@ int lftp_ssl_openssl::verify_crl(X509_STORE_CTX *ctx)
  46. obj = X509_OBJECT_new();
  47. store_ctx = X509_STORE_CTX_new();
  48. X509_STORE_CTX_init(store_ctx, instance->crl_store, NULL, NULL);
  49. - rc = X509_STORE_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj);
  50. + rc = X509_STORE_CTX_get_by_subject(store_ctx, X509_LU_CRL, issuer, obj);
  51. X509_STORE_CTX_free(store_ctx); store_ctx=0;
  52. crl = X509_OBJECT_get0_X509_CRL(obj);
  53. if (rc > 0 && crl != NULL) {
  54. --- a/src/lftp_ssl.h
  55. +++ b/src/lftp_ssl.h
  56. @@ -28,6 +28,7 @@
  57. # include <openssl/err.h>
  58. # include <openssl/rand.h>
  59. # include <openssl/x509v3.h>
  60. +# include <openssl/x509_vfy.h>
  61. # endif
  62. #include "Ref.h"