gtls.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef HEADER_CURL_GTLS_H
  2. #define HEADER_CURL_GTLS_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2016, Daniel Stenberg, <[email protected]>, 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.haxx.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. ***************************************************************************/
  24. #include "curl_setup.h"
  25. #ifdef USE_GNUTLS
  26. #include "urldata.h"
  27. int Curl_gtls_init(void);
  28. int Curl_gtls_cleanup(void);
  29. CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex);
  30. CURLcode Curl_gtls_connect_nonblocking(struct connectdata *conn,
  31. int sockindex,
  32. bool *done);
  33. bool Curl_gtls_data_pending(const struct connectdata *conn,
  34. int connindex);
  35. /* close a SSL connection */
  36. void Curl_gtls_close(struct connectdata *conn, int sockindex);
  37. void Curl_gtls_session_free(void *ptr);
  38. size_t Curl_gtls_version(char *buffer, size_t size);
  39. int Curl_gtls_shutdown(struct connectdata *conn, int sockindex);
  40. int Curl_gtls_random(struct Curl_easy *data,
  41. unsigned char *entropy,
  42. size_t length);
  43. void Curl_gtls_md5sum(unsigned char *tmp, /* input */
  44. size_t tmplen,
  45. unsigned char *md5sum, /* output */
  46. size_t md5len);
  47. void Curl_gtls_sha256sum(const unsigned char *tmp, /* input */
  48. size_t tmplen,
  49. unsigned char *sha256sum, /* output */
  50. size_t sha256len);
  51. bool Curl_gtls_cert_status_request(void);
  52. /* Support HTTPS-proxy */
  53. #define HTTPS_PROXY_SUPPORT 1
  54. /* Set the API backend definition to GnuTLS */
  55. #define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS
  56. /* this backend supports the CAPATH option */
  57. #define have_curlssl_ca_path 1
  58. /* this backend supports CURLOPT_CERTINFO */
  59. #define have_curlssl_certinfo 1
  60. /* this backend supports CURLOPT_PINNEDPUBLICKEY */
  61. #define have_curlssl_pinnedpubkey 1
  62. /* API setup for GnuTLS */
  63. #define curlssl_init Curl_gtls_init
  64. #define curlssl_cleanup Curl_gtls_cleanup
  65. #define curlssl_connect Curl_gtls_connect
  66. #define curlssl_connect_nonblocking Curl_gtls_connect_nonblocking
  67. #define curlssl_session_free(x) Curl_gtls_session_free(x)
  68. #define curlssl_close_all(x) ((void)x)
  69. #define curlssl_close Curl_gtls_close
  70. #define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y)
  71. #define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
  72. #define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
  73. #define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
  74. #define curlssl_version Curl_gtls_version
  75. #define curlssl_check_cxn(x) ((void)x, -1)
  76. #define curlssl_data_pending(x,y) Curl_gtls_data_pending(x,y)
  77. #define curlssl_random(x,y,z) Curl_gtls_random(x,y,z)
  78. #define curlssl_md5sum(a,b,c,d) Curl_gtls_md5sum(a,b,c,d)
  79. #define curlssl_sha256sum(a,b,c,d) Curl_gtls_sha256sum(a,b,c,d)
  80. #define curlssl_cert_status_request() Curl_gtls_cert_status_request()
  81. #endif /* USE_GNUTLS */
  82. #endif /* HEADER_CURL_GTLS_H */