openssl.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef HEADER_CURL_SSLUSE_H
  2. #define HEADER_CURL_SSLUSE_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2014, 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 http://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_SSLEAY
  26. /*
  27. * This header should only be needed to get included by vtls.c and openssl.c
  28. */
  29. #include "urldata.h"
  30. CURLcode Curl_ossl_connect(struct connectdata *conn, int sockindex);
  31. CURLcode Curl_ossl_connect_nonblocking(struct connectdata *conn,
  32. int sockindex,
  33. bool *done);
  34. /* close a SSL connection */
  35. void Curl_ossl_close(struct connectdata *conn, int sockindex);
  36. /* tell OpenSSL to close down all open information regarding connections (and
  37. thus session ID caching etc) */
  38. int Curl_ossl_close_all(struct SessionHandle *data);
  39. /* Sets an OpenSSL engine */
  40. CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine);
  41. /* function provided for the generic SSL-layer, called when a session id
  42. should be freed */
  43. void Curl_ossl_session_free(void *ptr);
  44. /* Sets engine as default for all SSL operations */
  45. CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data);
  46. /* Build list of OpenSSL engines */
  47. struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data);
  48. int Curl_ossl_init(void);
  49. void Curl_ossl_cleanup(void);
  50. size_t Curl_ossl_version(char *buffer, size_t size);
  51. int Curl_ossl_check_cxn(struct connectdata *cxn);
  52. int Curl_ossl_shutdown(struct connectdata *conn, int sockindex);
  53. bool Curl_ossl_data_pending(const struct connectdata *conn,
  54. int connindex);
  55. /* return 0 if a find random is filled in */
  56. int Curl_ossl_random(struct SessionHandle *data, unsigned char *entropy,
  57. size_t length);
  58. void Curl_ossl_md5sum(unsigned char *tmp, /* input */
  59. size_t tmplen,
  60. unsigned char *md5sum /* output */,
  61. size_t unused);
  62. /* this backend supports the CAPATH option */
  63. #define have_curlssl_ca_path 1
  64. /* this backend supports CURLOPT_CERTINFO */
  65. #define have_curlssl_certinfo 1
  66. /* this backend suppots CURLOPT_SSL_CTX_* */
  67. #define have_curlssl_ssl_ctx 1
  68. /* API setup for OpenSSL */
  69. #define curlssl_init Curl_ossl_init
  70. #define curlssl_cleanup Curl_ossl_cleanup
  71. #define curlssl_connect Curl_ossl_connect
  72. #define curlssl_connect_nonblocking Curl_ossl_connect_nonblocking
  73. #define curlssl_session_free(x) Curl_ossl_session_free(x)
  74. #define curlssl_close_all Curl_ossl_close_all
  75. #define curlssl_close Curl_ossl_close
  76. #define curlssl_shutdown(x,y) Curl_ossl_shutdown(x,y)
  77. #define curlssl_set_engine(x,y) Curl_ossl_set_engine(x,y)
  78. #define curlssl_set_engine_default(x) Curl_ossl_set_engine_default(x)
  79. #define curlssl_engines_list(x) Curl_ossl_engines_list(x)
  80. #define curlssl_version Curl_ossl_version
  81. #define curlssl_check_cxn Curl_ossl_check_cxn
  82. #define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y)
  83. #define curlssl_random(x,y,z) Curl_ossl_random(x,y,z)
  84. #define curlssl_md5sum(a,b,c,d) Curl_ossl_md5sum(a,b,c,d)
  85. #define CURL_SSL_BACKEND CURLSSLBACKEND_OPENSSL
  86. #define DEFAULT_CIPHER_SELECTION "ALL!EXPORT!EXPORT40!EXPORT56!aNULL!LOW!RC4"
  87. #endif /* USE_SSLEAY */
  88. #endif /* HEADER_CURL_SSLUSE_H */