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.

70 lines
2.0 KiB

  1. From a3d5b199f96a108f38bd1f6adaf3a7585f721d02 Mon Sep 17 00:00:00 2001
  2. From: Daniel Stenberg <daniel@haxx.se>
  3. Date: Thu, 15 Oct 2020 22:56:13 +0200
  4. Subject: [PATCH] openssl: acknowledge SRP disabling in configure properly
  5. Follow-up to 68a513247409
  6. Use a new separate define that is the combination of both
  7. HAVE_OPENSSL_SRP and USE_TLS_SRP: USE_OPENSSL_SRP
  8. Bug: https://curl.haxx.se/mail/lib-2020-10/0037.html
  9. Closes #6094
  10. ---
  11. lib/vtls/openssl.c | 16 ++++++++++++----
  12. 1 file changed, 12 insertions(+), 4 deletions(-)
  13. --- a/lib/vtls/openssl.c
  14. +++ b/lib/vtls/openssl.c
  15. @@ -225,6 +225,14 @@
  16. "ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH"
  17. #endif
  18. +#ifdef HAVE_OPENSSL_SRP
  19. +/* the function exists */
  20. +#ifdef USE_TLS_SRP
  21. +/* the functionality is not disabled */
  22. +#define USE_OPENSSL_SRP
  23. +#endif
  24. +#endif
  25. +
  26. struct ssl_backend_data {
  27. /* these ones requires specific SSL-types */
  28. SSL_CTX* ctx;
  29. @@ -2471,7 +2479,7 @@ static CURLcode ossl_connect_step1(struc
  30. #endif
  31. #endif
  32. const long int ssl_version = SSL_CONN_CONFIG(version);
  33. -#ifdef HAVE_OPENSSL_SRP
  34. +#ifdef USE_OPENSSL_SRP
  35. const enum CURL_TLSAUTH ssl_authtype = SSL_SET_OPTION(authtype);
  36. #endif
  37. char * const ssl_cert = SSL_SET_OPTION(primary.clientcert);
  38. @@ -2516,7 +2524,7 @@ static CURLcode ossl_connect_step1(struc
  39. failf(data, OSSL_PACKAGE " was built without SSLv2 support");
  40. return CURLE_NOT_BUILT_IN;
  41. #else
  42. -#ifdef HAVE_OPENSSL_SRP
  43. +#ifdef USE_OPENSSL_SRP
  44. if(ssl_authtype == CURL_TLSAUTH_SRP)
  45. return CURLE_SSL_CONNECT_ERROR;
  46. #endif
  47. @@ -2529,7 +2537,7 @@ static CURLcode ossl_connect_step1(struc
  48. failf(data, OSSL_PACKAGE " was built without SSLv3 support");
  49. return CURLE_NOT_BUILT_IN;
  50. #else
  51. -#ifdef HAVE_OPENSSL_SRP
  52. +#ifdef USE_OPENSSL_SRP
  53. if(ssl_authtype == CURL_TLSAUTH_SRP)
  54. return CURLE_SSL_CONNECT_ERROR;
  55. #endif
  56. @@ -2797,7 +2805,7 @@ static CURLcode ossl_connect_step1(struc
  57. }
  58. #endif
  59. -#ifdef HAVE_OPENSSL_SRP
  60. +#ifdef USE_OPENSSL_SRP
  61. if(ssl_authtype == CURL_TLSAUTH_SRP) {
  62. char * const ssl_username = SSL_SET_OPTION(username);