2
0

gtls.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef HEADER_CURL_GTLS_H
  2. #define HEADER_CURL_GTLS_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. #include "curl_setup.h"
  27. #include <curl/curl.h>
  28. #ifdef USE_GNUTLS
  29. #include <gnutls/gnutls.h>
  30. #ifdef HAVE_GNUTLS_SRP
  31. /* the function exists */
  32. #ifdef USE_TLS_SRP
  33. /* the functionality is not disabled */
  34. #define USE_GNUTLS_SRP
  35. #endif
  36. #endif
  37. struct Curl_easy;
  38. struct Curl_cfilter;
  39. struct ssl_primary_config;
  40. struct ssl_config_data;
  41. struct gtls_instance {
  42. gnutls_session_t session;
  43. gnutls_certificate_credentials_t cred;
  44. #ifdef USE_GNUTLS_SRP
  45. gnutls_srp_client_credentials_t srp_client_cred;
  46. #endif
  47. };
  48. CURLcode
  49. gtls_client_init(struct Curl_easy *data,
  50. struct ssl_primary_config *config,
  51. struct ssl_config_data *ssl_config,
  52. const char *hostname,
  53. struct gtls_instance *gtls,
  54. long *pverifyresult);
  55. CURLcode
  56. Curl_gtls_verifyserver(struct Curl_easy *data,
  57. gnutls_session_t session,
  58. struct ssl_primary_config *config,
  59. struct ssl_config_data *ssl_config,
  60. const char *hostname,
  61. const char *dispname,
  62. const char *pinned_key);
  63. extern const struct Curl_ssl Curl_ssl_gnutls;
  64. #endif /* USE_GNUTLS */
  65. #endif /* HEADER_CURL_GTLS_H */