schannel.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef HEADER_CURL_SCHANNEL_H
  2. #define HEADER_CURL_SCHANNEL_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 2012, Marc Hoersken, <[email protected]>, et al.
  11. * Copyright (C) 2012 - 2017, Daniel Stenberg, <[email protected]>, 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 https://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_SCHANNEL
  27. #include <schnlsp.h>
  28. #include <schannel.h>
  29. #include "curl_sspi.h"
  30. #include "urldata.h"
  31. extern const struct Curl_ssl Curl_ssl_schannel;
  32. CURLcode verify_certificate(struct connectdata *conn, int sockindex);
  33. /* structs to expose only in schannel.c and schannel_verify.c */
  34. #ifdef EXPOSE_SCHANNEL_INTERNAL_STRUCTS
  35. struct curl_schannel_cred {
  36. CredHandle cred_handle;
  37. TimeStamp time_stamp;
  38. int refcount;
  39. };
  40. struct curl_schannel_ctxt {
  41. CtxtHandle ctxt_handle;
  42. TimeStamp time_stamp;
  43. };
  44. struct ssl_backend_data {
  45. struct curl_schannel_cred *cred;
  46. struct curl_schannel_ctxt *ctxt;
  47. SecPkgContext_StreamSizes stream_sizes;
  48. size_t encdata_length, decdata_length;
  49. size_t encdata_offset, decdata_offset;
  50. unsigned char *encdata_buffer, *decdata_buffer;
  51. /* encdata_is_incomplete: if encdata contains only a partial record that
  52. can't be decrypted without another Curl_read_plain (that is, status is
  53. SEC_E_INCOMPLETE_MESSAGE) then set this true. after Curl_read_plain writes
  54. more bytes into encdata then set this back to false. */
  55. bool encdata_is_incomplete;
  56. unsigned long req_flags, ret_flags;
  57. CURLcode recv_unrecoverable_err; /* schannel_recv had an unrecoverable err */
  58. bool recv_sspi_close_notify; /* true if connection closed by close_notify */
  59. bool recv_connection_closed; /* true if connection closed, regardless how */
  60. bool use_alpn; /* true if ALPN is used for this connection */
  61. bool use_manual_cred_validation; /* true if manual cred validation is used */
  62. };
  63. #endif /* EXPOSE_SCHANNEL_INTERNAL_STRUCTS */
  64. #endif /* USE_SCHANNEL */
  65. #endif /* HEADER_CURL_SCHANNEL_H */