stub_gssapi.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. #ifndef HEADER_CURL_GSSAPI_STUBS_H
  2. #define HEADER_CURL_GSSAPI_STUBS_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 2017 - 2020, 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 https://curl.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. /* Roughly based on Heimdal's gssapi.h */
  25. #include <stdint.h>
  26. #include <stddef.h>
  27. #define GSS_ERROR(status) (status & 0x80000000)
  28. #define GSS_S_COMPLETE 0
  29. #define GSS_S_FAILURE (0x80000000)
  30. #define GSS_S_CONTINUE_NEEDED (1ul)
  31. #define GSS_C_QOP_DEFAULT 0
  32. #define GSS_C_NO_OID ((gss_OID) 0)
  33. #define GSS_C_NO_NAME ((gss_name_t) 0)
  34. #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
  35. #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
  36. #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
  37. #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
  38. #define GSS_C_NULL_OID GSS_C_NO_OID
  39. #define GSS_C_EMPTY_BUFFER {0, NULL}
  40. #define GSS_C_AF_INET 2
  41. #define GSS_C_GSS_CODE 1
  42. #define GSS_C_MECH_CODE 2
  43. #define GSS_C_DELEG_FLAG 1
  44. #define GSS_C_MUTUAL_FLAG 2
  45. #define GSS_C_REPLAY_FLAG 4
  46. #define GSS_C_CONF_FLAG 16
  47. #define GSS_C_INTEG_FLAG 32
  48. /*
  49. * Expiration time of 2^32-1 seconds means infinite lifetime for a
  50. * credential or security context
  51. */
  52. #define GSS_C_INDEFINITE 0xfffffffful
  53. #define GSS_C_NT_HOSTBASED_SERVICE NULL
  54. typedef uint32_t OM_uint32;
  55. typedef OM_uint32 gss_qop_t;
  56. typedef struct gss_buffer_desc_struct {
  57. size_t length;
  58. void *value;
  59. } gss_buffer_desc, *gss_buffer_t;
  60. struct gss_cred_id_t_desc_struct;
  61. typedef struct gss_cred_id_t_desc_struct *gss_cred_id_t;
  62. typedef const struct gss_cred_id_t_desc_struct *gss_const_cred_id_t;
  63. struct gss_ctx_id_t_desc_struct;
  64. typedef struct gss_ctx_id_t_desc_struct *gss_ctx_id_t;
  65. typedef const struct gss_ctx_id_t_desc_struct *gss_const_ctx_id_t;
  66. struct gss_name_t_desc_struct;
  67. typedef struct gss_name_t_desc_struct *gss_name_t;
  68. typedef const struct gss_name_t_desc_struct *gss_const_name_t;
  69. typedef struct gss_OID_desc_struct {
  70. OM_uint32 length;
  71. void *elements;
  72. } gss_OID_desc, *gss_OID;
  73. typedef struct gss_channel_bindings_struct {
  74. OM_uint32 initiator_addrtype;
  75. gss_buffer_desc initiator_address;
  76. OM_uint32 acceptor_addrtype;
  77. gss_buffer_desc acceptor_address;
  78. gss_buffer_desc application_data;
  79. } *gss_channel_bindings_t;
  80. OM_uint32 gss_release_buffer(OM_uint32 * /*minor_status*/,
  81. gss_buffer_t /*buffer*/);
  82. OM_uint32 gss_init_sec_context(OM_uint32 * /*minor_status*/,
  83. gss_const_cred_id_t /*initiator_cred_handle*/,
  84. gss_ctx_id_t * /*context_handle*/,
  85. gss_const_name_t /*target_name*/,
  86. const gss_OID /*mech_type*/,
  87. OM_uint32 /*req_flags*/,
  88. OM_uint32 /*time_req*/,
  89. const gss_channel_bindings_t /*input_chan_bindings*/,
  90. const gss_buffer_t /*input_token*/,
  91. gss_OID * /*actual_mech_type*/,
  92. gss_buffer_t /*output_token*/,
  93. OM_uint32 * /*ret_flags*/,
  94. OM_uint32 * /*time_rec*/);
  95. OM_uint32 gss_delete_sec_context(OM_uint32 * /*minor_status*/,
  96. gss_ctx_id_t * /*context_handle*/,
  97. gss_buffer_t /*output_token*/);
  98. OM_uint32 gss_inquire_context(OM_uint32 * /*minor_status*/,
  99. gss_const_ctx_id_t /*context_handle*/,
  100. gss_name_t * /*src_name*/,
  101. gss_name_t * /*targ_name*/,
  102. OM_uint32 * /*lifetime_rec*/,
  103. gss_OID * /*mech_type*/,
  104. OM_uint32 * /*ctx_flags*/,
  105. int * /*locally_initiated*/,
  106. int * /*open_context*/);
  107. OM_uint32 gss_wrap(OM_uint32 * /*minor_status*/,
  108. gss_const_ctx_id_t /*context_handle*/,
  109. int /*conf_req_flag*/,
  110. gss_qop_t /*qop_req*/,
  111. const gss_buffer_t /*input_message_buffer*/,
  112. int * /*conf_state*/,
  113. gss_buffer_t /*output_message_buffer*/);
  114. OM_uint32 gss_unwrap(OM_uint32 * /*minor_status*/,
  115. gss_const_ctx_id_t /*context_handle*/,
  116. const gss_buffer_t /*input_message_buffer*/,
  117. gss_buffer_t /*output_message_buffer*/,
  118. int * /*conf_state*/,
  119. gss_qop_t * /*qop_state*/);
  120. OM_uint32 gss_seal(OM_uint32 * /*minor_status*/,
  121. gss_ctx_id_t /*context_handle*/,
  122. int /*conf_req_flag*/,
  123. int /*qop_req*/,
  124. gss_buffer_t /*input_message_buffer*/,
  125. int * /*conf_state*/,
  126. gss_buffer_t /*output_message_buffer*/);
  127. OM_uint32 gss_unseal(OM_uint32 * /*minor_status*/,
  128. gss_ctx_id_t /*context_handle*/,
  129. gss_buffer_t /*input_message_buffer*/,
  130. gss_buffer_t /*output_message_buffer*/,
  131. int * /*conf_state*/,
  132. int * /*qop_state*/);
  133. OM_uint32 gss_import_name(OM_uint32 * /*minor_status*/,
  134. const gss_buffer_t /*input_name_buffer*/,
  135. const gss_OID /*input_name_type*/,
  136. gss_name_t * /*output_name*/);
  137. OM_uint32 gss_release_name(OM_uint32 * /*minor_status*/,
  138. gss_name_t * /*input_name*/);
  139. OM_uint32 gss_display_name(OM_uint32 * /*minor_status*/,
  140. gss_const_name_t /*input_name*/,
  141. gss_buffer_t /*output_name_buffer*/,
  142. gss_OID * /*output_name_type*/);
  143. OM_uint32 gss_display_status(OM_uint32 * /*minor_status*/,
  144. OM_uint32 /*status_value*/,
  145. int /*status_type*/,
  146. const gss_OID /*mech_type*/,
  147. OM_uint32 * /*message_context*/,
  148. gss_buffer_t /*status_string*/);
  149. #endif /* HEADER_CURL_GSSAPI_STUBS_H */