2
0

polarssl.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef HEADER_CURL_POLARSSL_H
  2. #define HEADER_CURL_POLARSSL_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com>
  11. * Copyright (C) 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
  12. *
  13. * This software is licensed as described in the file COPYING, which
  14. * you should have received as part of this distribution. The terms
  15. * are also available at http://curl.haxx.se/docs/copyright.html.
  16. *
  17. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  18. * copies of the Software, and permit persons to whom the Software is
  19. * furnished to do so, under the terms of the COPYING file.
  20. *
  21. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  22. * KIND, either express or implied.
  23. *
  24. ***************************************************************************/
  25. #include "curl_setup.h"
  26. #ifdef USE_POLARSSL
  27. /* Called on first use PolarSSL, setup threading if supported */
  28. int polarssl_init(void);
  29. void polarssl_cleanup(void);
  30. CURLcode Curl_polarssl_connect(struct connectdata *conn, int sockindex);
  31. CURLcode Curl_polarssl_connect_nonblocking(struct connectdata *conn,
  32. int sockindex,
  33. bool *done);
  34. /* tell PolarSSL to close down all open information regarding connections (and
  35. thus session ID caching etc) */
  36. void Curl_polarssl_close_all(struct SessionHandle *data);
  37. /* close a SSL connection */
  38. void Curl_polarssl_close(struct connectdata *conn, int sockindex);
  39. void Curl_polarssl_session_free(void *ptr);
  40. size_t Curl_polarssl_version(char *buffer, size_t size);
  41. int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex);
  42. /* this backend supports the CAPATH option */
  43. #define have_curlssl_ca_path 1
  44. /* API setup for PolarSSL */
  45. #define curlssl_init() polarssl_init()
  46. #define curlssl_cleanup() polarssl_cleanup()
  47. #define curlssl_connect Curl_polarssl_connect
  48. #define curlssl_connect_nonblocking Curl_polarssl_connect_nonblocking
  49. #define curlssl_session_free(x) Curl_polarssl_session_free(x)
  50. #define curlssl_close_all Curl_polarssl_close_all
  51. #define curlssl_close Curl_polarssl_close
  52. #define curlssl_shutdown(x,y) 0
  53. #define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
  54. #define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
  55. #define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
  56. #define curlssl_version Curl_polarssl_version
  57. #define curlssl_check_cxn(x) (x=x, -1)
  58. #define curlssl_data_pending(x,y) (x=x, y=y, 0)
  59. #define CURL_SSL_BACKEND CURLSSLBACKEND_POLARSSL
  60. /* This might cause libcurl to use a weeker random!
  61. TODO: implement proper use of Polarssl's CTR-DRBG or HMAC-DRBG and use that
  62. */
  63. #define curlssl_random(x,y,z) (x=x, y=y, z=z, CURLE_NOT_BUILT_IN)
  64. #endif /* USE_POLARSSL */
  65. #endif /* HEADER_CURL_POLARSSL_H */