ssluse.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef __SSLUSE_H
  2. #define __SSLUSE_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2010, 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. #ifdef USE_SSLEAY
  25. /*
  26. * This header should only be needed to get included by sslgen.c and ssluse.c
  27. */
  28. #include "urldata.h"
  29. CURLcode Curl_ossl_connect(struct connectdata *conn, int sockindex);
  30. CURLcode Curl_ossl_connect_nonblocking(struct connectdata *conn,
  31. int sockindex,
  32. bool *done);
  33. /* close a SSL connection */
  34. void Curl_ossl_close(struct connectdata *conn, int sockindex);
  35. /* tell OpenSSL to close down all open information regarding connections (and
  36. thus session ID caching etc) */
  37. int Curl_ossl_close_all(struct SessionHandle *data);
  38. /* Sets an OpenSSL engine */
  39. CURLcode Curl_ossl_set_engine(struct SessionHandle *data, const char *engine);
  40. /* function provided for the generic SSL-layer, called when a session id
  41. should be freed */
  42. void Curl_ossl_session_free(void *ptr);
  43. /* Sets engine as default for all SSL operations */
  44. CURLcode Curl_ossl_set_engine_default(struct SessionHandle *data);
  45. /* Build list of OpenSSL engines */
  46. struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data);
  47. int Curl_ossl_init(void);
  48. void Curl_ossl_cleanup(void);
  49. size_t Curl_ossl_version(char *buffer, size_t size);
  50. int Curl_ossl_check_cxn(struct connectdata *cxn);
  51. int Curl_ossl_seed(struct SessionHandle *data);
  52. int Curl_ossl_shutdown(struct connectdata *conn, int sockindex);
  53. bool Curl_ossl_data_pending(const struct connectdata *conn,
  54. int connindex);
  55. /* API setup for OpenSSL */
  56. #define curlssl_init Curl_ossl_init
  57. #define curlssl_cleanup Curl_ossl_cleanup
  58. #define curlssl_connect Curl_ossl_connect
  59. #define curlssl_connect_nonblocking Curl_ossl_connect_nonblocking
  60. #define curlssl_session_free(x) Curl_ossl_session_free(x)
  61. #define curlssl_close_all Curl_ossl_close_all
  62. #define curlssl_close Curl_ossl_close
  63. #define curlssl_shutdown(x,y) Curl_ossl_shutdown(x,y)
  64. #define curlssl_set_engine(x,y) Curl_ossl_set_engine(x,y)
  65. #define curlssl_set_engine_default(x) Curl_ossl_set_engine_default(x)
  66. #define curlssl_engines_list(x) Curl_ossl_engines_list(x)
  67. #define curlssl_version Curl_ossl_version
  68. #define curlssl_check_cxn Curl_ossl_check_cxn
  69. #define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y)
  70. #endif /* USE_SSLEAY */
  71. #endif /* __SSLUSE_H */