gssapi.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923
  1. /* This is the gssapi.h prologue. */
  2. /* no xom.h */
  3. /* End of gssapi.h prologue. */
  4. /* -*- mode: c; indent-tabs-mode: nil -*- */
  5. /*
  6. * Copyright 1993 by OpenVision Technologies, Inc.
  7. *
  8. * Permission to use, copy, modify, distribute, and sell this software
  9. * and its documentation for any purpose is hereby granted without fee,
  10. * provided that the above copyright notice appears in all copies and
  11. * that both that copyright notice and this permission notice appear in
  12. * supporting documentation, and that the name of OpenVision not be used
  13. * in advertising or publicity pertaining to distribution of the software
  14. * without specific, written prior permission. OpenVision makes no
  15. * representations about the suitability of this software for any
  16. * purpose. It is provided "as is" without express or implied warranty.
  17. *
  18. * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  19. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  20. * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22. * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23. * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  24. * PERFORMANCE OF THIS SOFTWARE.
  25. */
  26. #ifndef _GSSAPI_H_
  27. #define _GSSAPI_H_
  28. /*
  29. * Determine platform-dependent configuration.
  30. */
  31. #if defined(__MACH__) && defined(__APPLE__)
  32. # include <TargetConditionals.h>
  33. # if TARGET_RT_MAC_CFM
  34. # error "Use KfM 4.0 SDK headers for CFM compilation."
  35. # endif
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif /* __cplusplus */
  40. #if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
  41. #pragma pack(push,2)
  42. #endif
  43. #if defined(_MSDOS) || defined(_WIN32)
  44. #include <win-mac.h>
  45. #endif
  46. #ifndef KRB5_CALLCONV
  47. #define KRB5_CALLCONV
  48. #define KRB5_CALLCONV_C
  49. #endif
  50. #include <stdint.h>
  51. /*
  52. * First, include stddef.h to get size_t defined.
  53. */
  54. #include <stddef.h>
  55. /*
  56. * POSIX says that sys/types.h is where size_t is defined.
  57. */
  58. #include <sys/types.h>
  59. /*
  60. * $Id$
  61. */
  62. /*
  63. * First, define the three platform-dependent pointer types.
  64. */
  65. struct gss_name_struct;
  66. typedef struct gss_name_struct * gss_name_t;
  67. struct gss_cred_id_struct;
  68. typedef struct gss_cred_id_struct * gss_cred_id_t;
  69. struct gss_ctx_id_struct;
  70. typedef struct gss_ctx_id_struct * gss_ctx_id_t;
  71. /*
  72. * The following type must be defined as the smallest natural unsigned integer
  73. * supported by the platform that has at least 32 bits of precision.
  74. */
  75. typedef uint32_t gss_uint32;
  76. typedef int32_t gss_int32;
  77. #ifdef OM_STRING
  78. /*
  79. * We have included the xom.h header file. Use the definition for
  80. * OM_object identifier.
  81. */
  82. typedef OM_object_identifier gss_OID_desc, *gss_OID;
  83. #else /* OM_STRING */
  84. /*
  85. * We can't use X/Open definitions, so roll our own.
  86. */
  87. typedef gss_uint32 OM_uint32;
  88. typedef struct gss_OID_desc_struct {
  89. OM_uint32 length;
  90. void *elements;
  91. } gss_OID_desc, *gss_OID;
  92. #endif /* OM_STRING */
  93. typedef struct gss_OID_set_desc_struct {
  94. size_t count;
  95. gss_OID elements;
  96. } gss_OID_set_desc, *gss_OID_set;
  97. typedef struct gss_buffer_desc_struct {
  98. size_t length;
  99. void *value;
  100. } gss_buffer_desc, *gss_buffer_t;
  101. typedef struct gss_channel_bindings_struct {
  102. OM_uint32 initiator_addrtype;
  103. gss_buffer_desc initiator_address;
  104. OM_uint32 acceptor_addrtype;
  105. gss_buffer_desc acceptor_address;
  106. gss_buffer_desc application_data;
  107. } *gss_channel_bindings_t;
  108. /*
  109. * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
  110. * discussions).
  111. */
  112. typedef OM_uint32 gss_qop_t;
  113. typedef int gss_cred_usage_t;
  114. /*
  115. * Flag bits for context-level services.
  116. */
  117. #define GSS_C_DELEG_FLAG 1
  118. #define GSS_C_MUTUAL_FLAG 2
  119. #define GSS_C_REPLAY_FLAG 4
  120. #define GSS_C_SEQUENCE_FLAG 8
  121. #define GSS_C_CONF_FLAG 16
  122. #define GSS_C_INTEG_FLAG 32
  123. #define GSS_C_ANON_FLAG 64
  124. #define GSS_C_PROT_READY_FLAG 128
  125. #define GSS_C_TRANS_FLAG 256
  126. #define GSS_C_DELEG_POLICY_FLAG 32768
  127. /*
  128. * Credential usage options
  129. */
  130. #define GSS_C_BOTH 0
  131. #define GSS_C_INITIATE 1
  132. #define GSS_C_ACCEPT 2
  133. /*
  134. * Status code types for gss_display_status
  135. */
  136. #define GSS_C_GSS_CODE 1
  137. #define GSS_C_MECH_CODE 2
  138. /*
  139. * The constant definitions for channel-bindings address families
  140. */
  141. #define GSS_C_AF_UNSPEC 0
  142. #define GSS_C_AF_LOCAL 1
  143. #define GSS_C_AF_INET 2
  144. #define GSS_C_AF_IMPLINK 3
  145. #define GSS_C_AF_PUP 4
  146. #define GSS_C_AF_CHAOS 5
  147. #define GSS_C_AF_NS 6
  148. #define GSS_C_AF_NBS 7
  149. #define GSS_C_AF_ECMA 8
  150. #define GSS_C_AF_DATAKIT 9
  151. #define GSS_C_AF_CCITT 10
  152. #define GSS_C_AF_SNA 11
  153. #define GSS_C_AF_DECnet 12
  154. #define GSS_C_AF_DLI 13
  155. #define GSS_C_AF_LAT 14
  156. #define GSS_C_AF_HYLINK 15
  157. #define GSS_C_AF_APPLETALK 16
  158. #define GSS_C_AF_BSC 17
  159. #define GSS_C_AF_DSS 18
  160. #define GSS_C_AF_OSI 19
  161. #define GSS_C_AF_NETBIOS 20
  162. #define GSS_C_AF_X25 21
  163. #define GSS_C_AF_NULLADDR 255
  164. /*
  165. * Various Null values.
  166. */
  167. #define GSS_C_NO_NAME ((gss_name_t) 0)
  168. #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
  169. #define GSS_C_NO_OID ((gss_OID) 0)
  170. #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
  171. #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
  172. #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
  173. #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
  174. #define GSS_C_EMPTY_BUFFER {0, NULL}
  175. /*
  176. * Some alternate names for a couple of the above values. These are defined
  177. * for V1 compatibility.
  178. */
  179. #define GSS_C_NULL_OID GSS_C_NO_OID
  180. #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
  181. /*
  182. * Define the default Quality of Protection for per-message services. Note
  183. * that an implementation that offers multiple levels of QOP may either reserve
  184. * a value (for example zero, as assumed here) to mean "default protection", or
  185. * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
  186. * QOP value. However a value of 0 should always be interpreted by a GSSAPI
  187. * implementation as a request for the default protection level.
  188. */
  189. #define GSS_C_QOP_DEFAULT 0
  190. /*
  191. * Expiration time of 2^32-1 seconds means infinite lifetime for a
  192. * credential or security context
  193. */
  194. #define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
  195. /* Major status codes */
  196. #define GSS_S_COMPLETE 0
  197. /*
  198. * Some "helper" definitions to make the status code macros obvious.
  199. */
  200. #define GSS_C_CALLING_ERROR_OFFSET 24
  201. #define GSS_C_ROUTINE_ERROR_OFFSET 16
  202. #define GSS_C_SUPPLEMENTARY_OFFSET 0
  203. #define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
  204. #define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
  205. #define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
  206. /*
  207. * The macros that test status codes for error conditions. Note that the
  208. * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
  209. * evaluates its argument only once.
  210. */
  211. #define GSS_CALLING_ERROR(x) \
  212. ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
  213. #define GSS_ROUTINE_ERROR(x) \
  214. ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
  215. #define GSS_SUPPLEMENTARY_INFO(x) \
  216. ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
  217. #define GSS_ERROR(x) \
  218. ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
  219. (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
  220. /*
  221. * Now the actual status code definitions
  222. */
  223. /*
  224. * Calling errors:
  225. */
  226. #define GSS_S_CALL_INACCESSIBLE_READ \
  227. (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
  228. #define GSS_S_CALL_INACCESSIBLE_WRITE \
  229. (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
  230. #define GSS_S_CALL_BAD_STRUCTURE \
  231. (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
  232. /*
  233. * Routine errors:
  234. */
  235. #define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  236. #define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  237. #define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  238. #define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  239. #define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  240. #define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  241. #define GSS_S_BAD_MIC GSS_S_BAD_SIG
  242. #define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  243. #define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  244. #define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  245. #define GSS_S_DEFECTIVE_CREDENTIAL \
  246. (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  247. #define GSS_S_CREDENTIALS_EXPIRED \
  248. (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  249. #define GSS_S_CONTEXT_EXPIRED \
  250. (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  251. #define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  252. #define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  253. #define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  254. #define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  255. #define GSS_S_DUPLICATE_ELEMENT \
  256. (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  257. #define GSS_S_NAME_NOT_MN \
  258. (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  259. #define GSS_S_BAD_MECH_ATTR \
  260. (((OM_uint32) 19ul) << GSS_C_ROUTINE_ERROR_OFFSET)
  261. /*
  262. * Supplementary info bits:
  263. */
  264. #define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
  265. #define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
  266. #define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
  267. #define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
  268. #define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
  269. /*
  270. * Finally, function prototypes for the GSSAPI routines.
  271. */
  272. #if defined (_WIN32) && defined (_MSC_VER)
  273. # ifdef GSS_DLL_FILE
  274. # define GSS_DLLIMP __declspec(dllexport)
  275. # else
  276. # define GSS_DLLIMP __declspec(dllimport)
  277. # endif
  278. #else
  279. # define GSS_DLLIMP
  280. #endif
  281. /* Reserved static storage for GSS_oids. Comments are quotes from RFC 2744.
  282. *
  283. * The implementation must reserve static storage for a
  284. * gss_OID_desc object containing the value
  285. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
  286. * corresponding to an object-identifier value of
  287. * {iso(1) member-body(2) United States(840) mit(113554)
  288. * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
  289. * GSS_C_NT_USER_NAME should be initialized to point
  290. * to that gss_OID_desc.
  291. */
  292. GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME;
  293. /*
  294. * The implementation must reserve static storage for a
  295. * gss_OID_desc object containing the value
  296. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
  297. * corresponding to an object-identifier value of
  298. * {iso(1) member-body(2) United States(840) mit(113554)
  299. * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
  300. * The constant GSS_C_NT_MACHINE_UID_NAME should be
  301. * initialized to point to that gss_OID_desc.
  302. */
  303. GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
  304. /*
  305. * The implementation must reserve static storage for a
  306. * gss_OID_desc object containing the value
  307. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
  308. * corresponding to an object-identifier value of
  309. * {iso(1) member-body(2) United States(840) mit(113554)
  310. * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
  311. * The constant GSS_C_NT_STRING_UID_NAME should be
  312. * initialized to point to that gss_OID_desc.
  313. */
  314. GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME;
  315. /*
  316. * The implementation must reserve static storage for a
  317. * gss_OID_desc object containing the value
  318. * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
  319. * corresponding to an object-identifier value of
  320. * {iso(1) org(3) dod(6) internet(1) security(5)
  321. * nametypes(6) gss-host-based-services(2)). The constant
  322. * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
  323. * to that gss_OID_desc. This is a deprecated OID value, and
  324. * implementations wishing to support hostbased-service names
  325. * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
  326. * defined below, to identify such names;
  327. * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
  328. * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
  329. * parameter, but should not be emitted by GSS-API
  330. * implementations
  331. */
  332. GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
  333. /*
  334. * The implementation must reserve static storage for a
  335. * gss_OID_desc object containing the value
  336. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  337. * "\x01\x02\x01\x04"}, corresponding to an
  338. * object-identifier value of {iso(1) member-body(2)
  339. * Unites States(840) mit(113554) infosys(1) gssapi(2)
  340. * generic(1) service_name(4)}. The constant
  341. * GSS_C_NT_HOSTBASED_SERVICE should be initialized
  342. * to point to that gss_OID_desc.
  343. */
  344. GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
  345. /*
  346. * The implementation must reserve static storage for a
  347. * gss_OID_desc object containing the value
  348. * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
  349. * corresponding to an object identifier value of
  350. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  351. * 6(nametypes), 3(gss-anonymous-name)}. The constant
  352. * and GSS_C_NT_ANONYMOUS should be initialized to point
  353. * to that gss_OID_desc.
  354. */
  355. GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS;
  356. /*
  357. * The implementation must reserve static storage for a
  358. * gss_OID_desc object containing the value
  359. * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
  360. * corresponding to an object-identifier value of
  361. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  362. * 6(nametypes), 4(gss-api-exported-name)}. The constant
  363. * GSS_C_NT_EXPORT_NAME should be initialized to point
  364. * to that gss_OID_desc.
  365. */
  366. GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME;
  367. /* Function Prototypes */
  368. OM_uint32 KRB5_CALLCONV
  369. gss_acquire_cred(
  370. OM_uint32 *, /* minor_status */
  371. gss_name_t, /* desired_name */
  372. OM_uint32, /* time_req */
  373. gss_OID_set, /* desired_mechs */
  374. gss_cred_usage_t, /* cred_usage */
  375. gss_cred_id_t *, /* output_cred_handle */
  376. gss_OID_set *, /* actual_mechs */
  377. OM_uint32 *); /* time_rec */
  378. OM_uint32 KRB5_CALLCONV
  379. gss_release_cred(
  380. OM_uint32 *, /* minor_status */
  381. gss_cred_id_t *); /* cred_handle */
  382. OM_uint32 KRB5_CALLCONV
  383. gss_init_sec_context(
  384. OM_uint32 *, /* minor_status */
  385. gss_cred_id_t, /* claimant_cred_handle */
  386. gss_ctx_id_t *, /* context_handle */
  387. gss_name_t, /* target_name */
  388. gss_OID, /* mech_type (used to be const) */
  389. OM_uint32, /* req_flags */
  390. OM_uint32, /* time_req */
  391. gss_channel_bindings_t, /* input_chan_bindings */
  392. gss_buffer_t, /* input_token */
  393. gss_OID *, /* actual_mech_type */
  394. gss_buffer_t, /* output_token */
  395. OM_uint32 *, /* ret_flags */
  396. OM_uint32 *); /* time_rec */
  397. OM_uint32 KRB5_CALLCONV
  398. gss_accept_sec_context(
  399. OM_uint32 *, /* minor_status */
  400. gss_ctx_id_t *, /* context_handle */
  401. gss_cred_id_t, /* acceptor_cred_handle */
  402. gss_buffer_t, /* input_token_buffer */
  403. gss_channel_bindings_t, /* input_chan_bindings */
  404. gss_name_t *, /* src_name */
  405. gss_OID *, /* mech_type */
  406. gss_buffer_t, /* output_token */
  407. OM_uint32 *, /* ret_flags */
  408. OM_uint32 *, /* time_rec */
  409. gss_cred_id_t *); /* delegated_cred_handle */
  410. OM_uint32 KRB5_CALLCONV
  411. gss_process_context_token(
  412. OM_uint32 *, /* minor_status */
  413. gss_ctx_id_t, /* context_handle */
  414. gss_buffer_t); /* token_buffer */
  415. OM_uint32 KRB5_CALLCONV
  416. gss_delete_sec_context(
  417. OM_uint32 *, /* minor_status */
  418. gss_ctx_id_t *, /* context_handle */
  419. gss_buffer_t); /* output_token */
  420. OM_uint32 KRB5_CALLCONV
  421. gss_context_time(
  422. OM_uint32 *, /* minor_status */
  423. gss_ctx_id_t, /* context_handle */
  424. OM_uint32 *); /* time_rec */
  425. /* New for V2 */
  426. OM_uint32 KRB5_CALLCONV
  427. gss_get_mic(
  428. OM_uint32 *, /* minor_status */
  429. gss_ctx_id_t, /* context_handle */
  430. gss_qop_t, /* qop_req */
  431. gss_buffer_t, /* message_buffer */
  432. gss_buffer_t); /* message_token */
  433. /* New for V2 */
  434. OM_uint32 KRB5_CALLCONV
  435. gss_verify_mic(OM_uint32 *, /* minor_status */
  436. gss_ctx_id_t, /* context_handle */
  437. gss_buffer_t, /* message_buffer */
  438. gss_buffer_t, /* message_token */
  439. gss_qop_t * /* qop_state */
  440. );
  441. /* New for V2 */
  442. OM_uint32 KRB5_CALLCONV
  443. gss_wrap(
  444. OM_uint32 *, /* minor_status */
  445. gss_ctx_id_t, /* context_handle */
  446. int, /* conf_req_flag */
  447. gss_qop_t, /* qop_req */
  448. gss_buffer_t, /* input_message_buffer */
  449. int *, /* conf_state */
  450. gss_buffer_t); /* output_message_buffer */
  451. /* New for V2 */
  452. OM_uint32 KRB5_CALLCONV
  453. gss_unwrap(
  454. OM_uint32 *, /* minor_status */
  455. gss_ctx_id_t, /* context_handle */
  456. gss_buffer_t, /* input_message_buffer */
  457. gss_buffer_t, /* output_message_buffer */
  458. int *, /* conf_state */
  459. gss_qop_t *); /* qop_state */
  460. OM_uint32 KRB5_CALLCONV
  461. gss_display_status(
  462. OM_uint32 *, /* minor_status */
  463. OM_uint32, /* status_value */
  464. int, /* status_type */
  465. gss_OID, /* mech_type (used to be const) */
  466. OM_uint32 *, /* message_context */
  467. gss_buffer_t); /* status_string */
  468. OM_uint32 KRB5_CALLCONV
  469. gss_indicate_mechs(
  470. OM_uint32 *, /* minor_status */
  471. gss_OID_set *); /* mech_set */
  472. OM_uint32 KRB5_CALLCONV
  473. gss_compare_name(
  474. OM_uint32 *, /* minor_status */
  475. gss_name_t, /* name1 */
  476. gss_name_t, /* name2 */
  477. int *); /* name_equal */
  478. OM_uint32 KRB5_CALLCONV
  479. gss_display_name(
  480. OM_uint32 *, /* minor_status */
  481. gss_name_t, /* input_name */
  482. gss_buffer_t, /* output_name_buffer */
  483. gss_OID *); /* output_name_type */
  484. OM_uint32 KRB5_CALLCONV
  485. gss_import_name(
  486. OM_uint32 *, /* minor_status */
  487. gss_buffer_t, /* input_name_buffer */
  488. gss_OID, /* input_name_type(used to be const) */
  489. gss_name_t *); /* output_name */
  490. OM_uint32 KRB5_CALLCONV
  491. gss_release_name(
  492. OM_uint32 *, /* minor_status */
  493. gss_name_t *); /* input_name */
  494. OM_uint32 KRB5_CALLCONV
  495. gss_release_buffer(
  496. OM_uint32 *, /* minor_status */
  497. gss_buffer_t); /* buffer */
  498. OM_uint32 KRB5_CALLCONV
  499. gss_release_oid_set(
  500. OM_uint32 *, /* minor_status */
  501. gss_OID_set *); /* set */
  502. OM_uint32 KRB5_CALLCONV
  503. gss_inquire_cred(
  504. OM_uint32 *, /* minor_status */
  505. gss_cred_id_t, /* cred_handle */
  506. gss_name_t *, /* name */
  507. OM_uint32 *, /* lifetime */
  508. gss_cred_usage_t *, /* cred_usage */
  509. gss_OID_set *); /* mechanisms */
  510. /* Last argument new for V2 */
  511. OM_uint32 KRB5_CALLCONV
  512. gss_inquire_context(
  513. OM_uint32 *, /* minor_status */
  514. gss_ctx_id_t, /* context_handle */
  515. gss_name_t *, /* src_name */
  516. gss_name_t *, /* targ_name */
  517. OM_uint32 *, /* lifetime_rec */
  518. gss_OID *, /* mech_type */
  519. OM_uint32 *, /* ctx_flags */
  520. int *, /* locally_initiated */
  521. int *); /* open */
  522. /* New for V2 */
  523. OM_uint32 KRB5_CALLCONV
  524. gss_wrap_size_limit(
  525. OM_uint32 *, /* minor_status */
  526. gss_ctx_id_t, /* context_handle */
  527. int, /* conf_req_flag */
  528. gss_qop_t, /* qop_req */
  529. OM_uint32, /* req_output_size */
  530. OM_uint32 *); /* max_input_size */
  531. /* New for V2 */
  532. OM_uint32 KRB5_CALLCONV
  533. gss_import_name_object(
  534. OM_uint32 *, /* minor_status */
  535. void *, /* input_name */
  536. gss_OID, /* input_name_type */
  537. gss_name_t *); /* output_name */
  538. /* New for V2 */
  539. OM_uint32 KRB5_CALLCONV
  540. gss_export_name_object(
  541. OM_uint32 *, /* minor_status */
  542. gss_name_t, /* input_name */
  543. gss_OID, /* desired_name_type */
  544. void **); /* output_name */
  545. /* New for V2 */
  546. OM_uint32 KRB5_CALLCONV
  547. gss_add_cred(
  548. OM_uint32 *, /* minor_status */
  549. gss_cred_id_t, /* input_cred_handle */
  550. gss_name_t, /* desired_name */
  551. gss_OID, /* desired_mech */
  552. gss_cred_usage_t, /* cred_usage */
  553. OM_uint32, /* initiator_time_req */
  554. OM_uint32, /* acceptor_time_req */
  555. gss_cred_id_t *, /* output_cred_handle */
  556. gss_OID_set *, /* actual_mechs */
  557. OM_uint32 *, /* initiator_time_rec */
  558. OM_uint32 *); /* acceptor_time_rec */
  559. /* New for V2 */
  560. OM_uint32 KRB5_CALLCONV
  561. gss_inquire_cred_by_mech(
  562. OM_uint32 *, /* minor_status */
  563. gss_cred_id_t, /* cred_handle */
  564. gss_OID, /* mech_type */
  565. gss_name_t *, /* name */
  566. OM_uint32 *, /* initiator_lifetime */
  567. OM_uint32 *, /* acceptor_lifetime */
  568. gss_cred_usage_t *); /* cred_usage */
  569. /* New for V2 */
  570. OM_uint32 KRB5_CALLCONV
  571. gss_export_sec_context(
  572. OM_uint32 *, /* minor_status */
  573. gss_ctx_id_t *, /* context_handle */
  574. gss_buffer_t); /* interprocess_token */
  575. /* New for V2 */
  576. OM_uint32 KRB5_CALLCONV
  577. gss_import_sec_context(
  578. OM_uint32 *, /* minor_status */
  579. gss_buffer_t, /* interprocess_token */
  580. gss_ctx_id_t *); /* context_handle */
  581. /* New for V2 */
  582. OM_uint32 KRB5_CALLCONV
  583. gss_release_oid(
  584. OM_uint32 *, /* minor_status */
  585. gss_OID *); /* oid */
  586. /* New for V2 */
  587. OM_uint32 KRB5_CALLCONV
  588. gss_create_empty_oid_set(
  589. OM_uint32 *, /* minor_status */
  590. gss_OID_set *); /* oid_set */
  591. /* New for V2 */
  592. OM_uint32 KRB5_CALLCONV
  593. gss_add_oid_set_member(
  594. OM_uint32 *, /* minor_status */
  595. gss_OID, /* member_oid */
  596. gss_OID_set *); /* oid_set */
  597. /* New for V2 */
  598. OM_uint32 KRB5_CALLCONV
  599. gss_test_oid_set_member(
  600. OM_uint32 *, /* minor_status */
  601. gss_OID, /* member */
  602. gss_OID_set, /* set */
  603. int *); /* present */
  604. /* New for V2 */
  605. OM_uint32 KRB5_CALLCONV
  606. gss_str_to_oid(
  607. OM_uint32 *, /* minor_status */
  608. gss_buffer_t, /* oid_str */
  609. gss_OID *); /* oid */
  610. /* New for V2 */
  611. OM_uint32 KRB5_CALLCONV
  612. gss_oid_to_str(
  613. OM_uint32 *, /* minor_status */
  614. gss_OID, /* oid */
  615. gss_buffer_t); /* oid_str */
  616. /* New for V2 */
  617. OM_uint32 KRB5_CALLCONV
  618. gss_inquire_names_for_mech(
  619. OM_uint32 *, /* minor_status */
  620. gss_OID, /* mechanism */
  621. gss_OID_set *); /* name_types */
  622. /* New for V2 */
  623. OM_uint32 KRB5_CALLCONV
  624. gss_inquire_mechs_for_name(
  625. OM_uint32 *, /* minor_status */
  626. const gss_name_t, /* input_name */
  627. gss_OID_set *); /* mech_types */
  628. /*
  629. * The following routines are obsolete variants of gss_get_mic, gss_wrap,
  630. * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2
  631. * implementations for backwards compatibility with V1 applications. Distinct
  632. * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
  633. * V1 applications to link against GSSAPI V2 implementations.
  634. */
  635. OM_uint32 KRB5_CALLCONV
  636. gss_sign(
  637. OM_uint32 *, /* minor_status */
  638. gss_ctx_id_t, /* context_handle */
  639. int, /* qop_req */
  640. gss_buffer_t, /* message_buffer */
  641. gss_buffer_t); /* message_token */
  642. OM_uint32 KRB5_CALLCONV
  643. gss_verify(
  644. OM_uint32 *, /* minor_status */
  645. gss_ctx_id_t, /* context_handle */
  646. gss_buffer_t, /* message_buffer */
  647. gss_buffer_t, /* token_buffer */
  648. int *); /* qop_state */
  649. OM_uint32 KRB5_CALLCONV
  650. gss_seal(
  651. OM_uint32 *, /* minor_status */
  652. gss_ctx_id_t, /* context_handle */
  653. int, /* conf_req_flag */
  654. int, /* qop_req */
  655. gss_buffer_t, /* input_message_buffer */
  656. int *, /* conf_state */
  657. gss_buffer_t); /* output_message_buffer */
  658. OM_uint32 KRB5_CALLCONV
  659. gss_unseal(
  660. OM_uint32 *, /* minor_status */
  661. gss_ctx_id_t, /* context_handle */
  662. gss_buffer_t, /* input_message_buffer */
  663. gss_buffer_t, /* output_message_buffer */
  664. int *, /* conf_state */
  665. int *); /* qop_state */
  666. /* New for V2 */
  667. OM_uint32 KRB5_CALLCONV
  668. gss_export_name(
  669. OM_uint32 *, /* minor_status */
  670. const gss_name_t, /* input_name */
  671. gss_buffer_t); /* exported_name */
  672. /* New for V2 */
  673. OM_uint32 KRB5_CALLCONV
  674. gss_duplicate_name(
  675. OM_uint32 *, /* minor_status */
  676. const gss_name_t, /* input_name */
  677. gss_name_t *); /* dest_name */
  678. /* New for V2 */
  679. OM_uint32 KRB5_CALLCONV
  680. gss_canonicalize_name(
  681. OM_uint32 *, /* minor_status */
  682. const gss_name_t, /* input_name */
  683. const gss_OID, /* mech_type */
  684. gss_name_t *); /* output_name */
  685. /* RFC 4401 */
  686. #define GSS_C_PRF_KEY_FULL 0
  687. #define GSS_C_PRF_KEY_PARTIAL 1
  688. OM_uint32 KRB5_CALLCONV
  689. gss_pseudo_random(
  690. OM_uint32 *, /* minor_status */
  691. gss_ctx_id_t, /* context */
  692. int, /* prf_key */
  693. const gss_buffer_t, /* prf_in */
  694. ssize_t, /* desired_output_len */
  695. gss_buffer_t); /* prf_out */
  696. OM_uint32 KRB5_CALLCONV
  697. gss_store_cred(
  698. OM_uint32 *, /* minor_status */
  699. const gss_cred_id_t,/* input_cred_handle */
  700. gss_cred_usage_t, /* input_usage */
  701. const gss_OID, /* desired_mech */
  702. OM_uint32, /* overwrite_cred */
  703. OM_uint32, /* default_cred */
  704. gss_OID_set *, /* elements_stored */
  705. gss_cred_usage_t *);/* cred_usage_stored */
  706. OM_uint32 KRB5_CALLCONV
  707. gss_set_neg_mechs(
  708. OM_uint32 *, /* minor_status */
  709. gss_cred_id_t, /* cred_handle */
  710. const gss_OID_set); /* mech_set */
  711. #if defined(__APPLE__) && (defined(__ppc__) || defined(__ppc64__) || defined(__i386__) || defined(__x86_64__))
  712. #pragma pack(pop)
  713. #endif
  714. #ifdef __cplusplus
  715. }
  716. #endif
  717. /* XXXX these are not part of the GSSAPI C bindings! (but should be) */
  718. #define GSS_CALLING_ERROR_FIELD(x) \
  719. (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
  720. #define GSS_ROUTINE_ERROR_FIELD(x) \
  721. (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
  722. #define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
  723. (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
  724. /* XXXX This is a necessary evil until the spec is fixed */
  725. #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
  726. /*
  727. * RFC 5587
  728. */
  729. typedef const gss_buffer_desc *gss_const_buffer_t;
  730. typedef const struct gss_channel_bindings_struct *gss_const_channel_bindings_t;
  731. typedef const struct gss_ctx_id_struct *gss_const_ctx_id_t;
  732. typedef const struct gss_cred_id_struct *gss_const_cred_id_t;
  733. typedef const struct gss_name_struct *gss_const_name_t;
  734. typedef const gss_OID_desc *gss_const_OID;
  735. typedef const gss_OID_set_desc *gss_const_OID_set;
  736. OM_uint32 KRB5_CALLCONV
  737. gss_indicate_mechs_by_attrs(
  738. OM_uint32 *, /* minor_status */
  739. gss_const_OID_set, /* desired_mech_attrs */
  740. gss_const_OID_set, /* except_mech_attrs */
  741. gss_const_OID_set, /* critical_mech_attrs */
  742. gss_OID_set *); /* mechs */
  743. OM_uint32 KRB5_CALLCONV
  744. gss_inquire_attrs_for_mech(
  745. OM_uint32 *, /* minor_status */
  746. gss_const_OID, /* mech */
  747. gss_OID_set *, /* mech_attrs */
  748. gss_OID_set *); /* known_mech_attrs */
  749. OM_uint32 KRB5_CALLCONV
  750. gss_display_mech_attr(
  751. OM_uint32 *, /* minor_status */
  752. gss_const_OID, /* mech_attr */
  753. gss_buffer_t, /* name */
  754. gss_buffer_t, /* short_desc */
  755. gss_buffer_t); /* long_desc */
  756. GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_CONCRETE;
  757. GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_PSEUDO;
  758. GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_COMPOSITE;
  759. GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_NEGO;
  760. GSS_DLLIMP extern gss_const_OID GSS_C_MA_MECH_GLUE;
  761. GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_MECH;
  762. GSS_DLLIMP extern gss_const_OID GSS_C_MA_DEPRECATED;
  763. GSS_DLLIMP extern gss_const_OID GSS_C_MA_NOT_DFLT_MECH;
  764. GSS_DLLIMP extern gss_const_OID GSS_C_MA_ITOK_FRAMED;
  765. GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT;
  766. GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG;
  767. GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_INIT;
  768. GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_INIT;
  769. GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_INIT_ANON;
  770. GSS_DLLIMP extern gss_const_OID GSS_C_MA_AUTH_TARG_ANON;
  771. GSS_DLLIMP extern gss_const_OID GSS_C_MA_DELEG_CRED;
  772. GSS_DLLIMP extern gss_const_OID GSS_C_MA_INTEG_PROT;
  773. GSS_DLLIMP extern gss_const_OID GSS_C_MA_CONF_PROT;
  774. GSS_DLLIMP extern gss_const_OID GSS_C_MA_MIC;
  775. GSS_DLLIMP extern gss_const_OID GSS_C_MA_WRAP;
  776. GSS_DLLIMP extern gss_const_OID GSS_C_MA_PROT_READY;
  777. GSS_DLLIMP extern gss_const_OID GSS_C_MA_REPLAY_DET;
  778. GSS_DLLIMP extern gss_const_OID GSS_C_MA_OOS_DET;
  779. GSS_DLLIMP extern gss_const_OID GSS_C_MA_CBINDINGS;
  780. GSS_DLLIMP extern gss_const_OID GSS_C_MA_PFS;
  781. GSS_DLLIMP extern gss_const_OID GSS_C_MA_COMPRESS;
  782. GSS_DLLIMP extern gss_const_OID GSS_C_MA_CTX_TRANS;
  783. /*
  784. * RFC 5801
  785. */
  786. OM_uint32 KRB5_CALLCONV
  787. gss_inquire_saslname_for_mech(
  788. OM_uint32 *, /* minor_status */
  789. const gss_OID, /* desired_mech */
  790. gss_buffer_t, /* sasl_mech_name */
  791. gss_buffer_t, /* mech_name */
  792. gss_buffer_t /* mech_description */
  793. );
  794. OM_uint32 KRB5_CALLCONV
  795. gss_inquire_mech_for_saslname(
  796. OM_uint32 *, /* minor_status */
  797. const gss_buffer_t, /* sasl_mech_name */
  798. gss_OID * /* mech_type */
  799. );
  800. #endif /* _GSSAPI_H_ */