/include/gssapi/gssapi.h

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 849 lines · 509 code · 112 blank · 228 comment · 1 complexity · 683bb369194cc3d297a8761c453d4992 MD5 · raw file

  1. /*
  2. * Copyright (C) The Internet Society (2000). All Rights Reserved.
  3. *
  4. * This document and translations of it may be copied and furnished to
  5. * others, and derivative works that comment on or otherwise explain it
  6. * or assist in its implementation may be prepared, copied, published
  7. * and distributed, in whole or in part, without restriction of any
  8. * kind, provided that the above copyright notice and this paragraph are
  9. * included on all such copies and derivative works. However, this
  10. * document itself may not be modified in any way, such as by removing
  11. * the copyright notice or references to the Internet Society or other
  12. * Internet organizations, except as needed for the purpose of
  13. * developing Internet standards in which case the procedures for
  14. * copyrights defined in the Internet Standards process must be
  15. * followed, or as required to translate it into languages other than
  16. * English.
  17. *
  18. * The limited permissions granted above are perpetual and will not be
  19. * revoked by the Internet Society or its successors or assigns.
  20. *
  21. * This document and the information contained herein is provided on an
  22. * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  23. * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  24. * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  25. * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  26. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  27. *
  28. * $FreeBSD$
  29. */
  30. #ifndef _GSSAPI_GSSAPI_H_
  31. #define _GSSAPI_GSSAPI_H_
  32. #include <sys/cdefs.h>
  33. #include <sys/_types.h>
  34. #ifndef _SIZE_T_DECLARED
  35. typedef __size_t size_t;
  36. #define _SIZE_T_DECLARED
  37. #endif
  38. #ifndef _SSIZE_T_DECLARED
  39. typedef __ssize_t ssize_t;
  40. #define _SSIZE_T_DECLARED
  41. #endif
  42. #if 0
  43. /*
  44. * If the platform supports the xom.h header file, it should be
  45. * included here.
  46. */
  47. #include <xom.h>
  48. #endif
  49. /*
  50. * Now define the three implementation-dependent types.
  51. */
  52. typedef struct _gss_ctx_id_t *gss_ctx_id_t;
  53. typedef struct _gss_cred_id_t *gss_cred_id_t;
  54. typedef struct _gss_name_t *gss_name_t;
  55. /*
  56. * The following type must be defined as the smallest natural
  57. * unsigned integer supported by the platform that has at least
  58. * 32 bits of precision.
  59. */
  60. typedef __uint32_t gss_uint32;
  61. #ifdef OM_STRING
  62. /*
  63. * We have included the xom.h header file. Verify that OM_uint32
  64. * is defined correctly.
  65. */
  66. #if sizeof(gss_uint32) != sizeof(OM_uint32)
  67. #error Incompatible definition of OM_uint32 from xom.h
  68. #endif
  69. typedef OM_object_identifier gss_OID_desc, *gss_OID;
  70. #else
  71. /*
  72. * We can't use X/Open definitions, so roll our own.
  73. */
  74. typedef gss_uint32 OM_uint32;
  75. typedef __uint64_t OM_uint64;
  76. typedef struct gss_OID_desc_struct {
  77. OM_uint32 length;
  78. void *elements;
  79. } gss_OID_desc, *gss_OID;
  80. #endif
  81. typedef struct gss_OID_set_desc_struct {
  82. size_t count;
  83. gss_OID elements;
  84. } gss_OID_set_desc, *gss_OID_set;
  85. typedef struct gss_buffer_desc_struct {
  86. size_t length;
  87. void *value;
  88. } gss_buffer_desc, *gss_buffer_t;
  89. typedef struct gss_channel_bindings_struct {
  90. OM_uint32 initiator_addrtype;
  91. gss_buffer_desc initiator_address;
  92. OM_uint32 acceptor_addrtype;
  93. gss_buffer_desc acceptor_address;
  94. gss_buffer_desc application_data;
  95. } *gss_channel_bindings_t;
  96. /*
  97. * For now, define a QOP-type as an OM_uint32
  98. */
  99. typedef OM_uint32 gss_qop_t;
  100. typedef int gss_cred_usage_t;
  101. /*
  102. * Flag bits for context-level services.
  103. */
  104. #define GSS_C_DELEG_FLAG 1
  105. #define GSS_C_MUTUAL_FLAG 2
  106. #define GSS_C_REPLAY_FLAG 4
  107. #define GSS_C_SEQUENCE_FLAG 8
  108. #define GSS_C_CONF_FLAG 16
  109. #define GSS_C_INTEG_FLAG 32
  110. #define GSS_C_ANON_FLAG 64
  111. #define GSS_C_PROT_READY_FLAG 128
  112. #define GSS_C_TRANS_FLAG 256
  113. /*
  114. * Credential usage options
  115. */
  116. #define GSS_C_BOTH 0
  117. #define GSS_C_INITIATE 1
  118. #define GSS_C_ACCEPT 2
  119. /*
  120. * Status code types for gss_display_status
  121. */
  122. #define GSS_C_GSS_CODE 1
  123. #define GSS_C_MECH_CODE 2
  124. /*
  125. * The constant definitions for channel-bindings address families
  126. */
  127. #define GSS_C_AF_UNSPEC 0
  128. #define GSS_C_AF_LOCAL 1
  129. #define GSS_C_AF_INET 2
  130. #define GSS_C_AF_IMPLINK 3
  131. #define GSS_C_AF_PUP 4
  132. #define GSS_C_AF_CHAOS 5
  133. #define GSS_C_AF_NS 6
  134. #define GSS_C_AF_NBS 7
  135. #define GSS_C_AF_ECMA 8
  136. #define GSS_C_AF_DATAKIT 9
  137. #define GSS_C_AF_CCITT 10
  138. #define GSS_C_AF_SNA 11
  139. #define GSS_C_AF_DECnet 12
  140. #define GSS_C_AF_DLI 13
  141. #define GSS_C_AF_LAT 14
  142. #define GSS_C_AF_HYLINK 15
  143. #define GSS_C_AF_APPLETALK 16
  144. #define GSS_C_AF_BSC 17
  145. #define GSS_C_AF_DSS 18
  146. #define GSS_C_AF_OSI 19
  147. #define GSS_C_AF_X25 21
  148. #define GSS_C_AF_NULLADDR 255
  149. /*
  150. * Various Null values
  151. */
  152. #define GSS_C_NO_NAME ((gss_name_t) 0)
  153. #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
  154. #define GSS_C_NO_OID ((gss_OID) 0)
  155. #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
  156. #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
  157. #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
  158. #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
  159. #define GSS_C_EMPTY_BUFFER {0, NULL}
  160. /*
  161. * Some alternate names for a couple of the above
  162. * values. These are defined for V1 compatibility.
  163. */
  164. #define GSS_C_NULL_OID GSS_C_NO_OID
  165. #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
  166. /*
  167. * Define the default Quality of Protection for per-message
  168. * services. Note that an implementation that offers multiple
  169. * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
  170. * (as done here) to mean "default protection", or to a specific
  171. * explicit QOP value. However, a value of 0 should always be
  172. * interpreted by a GSS-API implementation as a request for the
  173. * default protection level.
  174. */
  175. #define GSS_C_QOP_DEFAULT 0
  176. /*
  177. * Expiration time of 2^32-1 seconds means infinite lifetime for a
  178. * credential or security context
  179. */
  180. #define GSS_C_INDEFINITE 0xfffffffful
  181. /*
  182. * The implementation must reserve static storage for a
  183. * gss_OID_desc object containing the value
  184. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  185. * "\x01\x02\x01\x01"},
  186. * corresponding to an object-identifier value of
  187. * {iso(1) member-body(2) United States(840) mit(113554)
  188. * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
  189. * GSS_C_NT_USER_NAME should be initialized to point
  190. * to that gss_OID_desc.
  191. */
  192. extern gss_OID GSS_C_NT_USER_NAME;
  193. /*
  194. * The implementation must reserve static storage for a
  195. * gss_OID_desc object containing the value
  196. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  197. * "\x01\x02\x01\x02"},
  198. * corresponding to an object-identifier value of
  199. * {iso(1) member-body(2) United States(840) mit(113554)
  200. * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
  201. * The constant GSS_C_NT_MACHINE_UID_NAME should be
  202. * initialized to point to that gss_OID_desc.
  203. */
  204. extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
  205. /*
  206. * The implementation must reserve static storage for a
  207. * gss_OID_desc object containing the value
  208. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  209. * "\x01\x02\x01\x03"},
  210. * corresponding to an object-identifier value of
  211. * {iso(1) member-body(2) United States(840) mit(113554)
  212. * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
  213. * The constant GSS_C_NT_STRING_UID_NAME should be
  214. * initialized to point to that gss_OID_desc.
  215. */
  216. extern gss_OID GSS_C_NT_STRING_UID_NAME;
  217. /*
  218. * The implementation must reserve static storage for a
  219. * gss_OID_desc object containing the value
  220. * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
  221. * corresponding to an object-identifier value of
  222. * {iso(1) org(3) dod(6) internet(1) security(5)
  223. * nametypes(6) gss-host-based-services(2)). The constant
  224. * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
  225. * to that gss_OID_desc. This is a deprecated OID value, and
  226. * implementations wishing to support hostbased-service names
  227. * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
  228. * defined below, to identify such names;
  229. * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
  230. * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
  231. * parameter, but should not be emitted by GSS-API
  232. * implementations
  233. */
  234. extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
  235. /*
  236. * The implementation must reserve static storage for a
  237. * gss_OID_desc object containing the value
  238. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  239. * "\x01\x02\x01\x04"}, corresponding to an
  240. * object-identifier value of {iso(1) member-body(2)
  241. * Unites States(840) mit(113554) infosys(1) gssapi(2)
  242. * generic(1) service_name(4)}. The constant
  243. * GSS_C_NT_HOSTBASED_SERVICE should be initialized
  244. * to point to that gss_OID_desc.
  245. */
  246. extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
  247. /*
  248. * The implementation must reserve static storage for a
  249. * gss_OID_desc object containing the value
  250. * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
  251. * corresponding to an object identifier value of
  252. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  253. * 6(nametypes), 3(gss-anonymous-name)}. The constant
  254. * and GSS_C_NT_ANONYMOUS should be initialized to point
  255. * to that gss_OID_desc.
  256. */
  257. extern gss_OID GSS_C_NT_ANONYMOUS;
  258. /*
  259. * The implementation must reserve static storage for a
  260. * gss_OID_desc object containing the value
  261. * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
  262. * corresponding to an object-identifier value of
  263. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  264. * 6(nametypes), 4(gss-api-exported-name)}. The constant
  265. * GSS_C_NT_EXPORT_NAME should be initialized to point
  266. * to that gss_OID_desc.
  267. */
  268. extern gss_OID GSS_C_NT_EXPORT_NAME;
  269. /*
  270. * This name form shall be represented by the Object Identifier {iso(1)
  271. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  272. * krb5(2) krb5_name(1)}. The recommended symbolic name for this type
  273. * is "GSS_KRB5_NT_PRINCIPAL_NAME".
  274. */
  275. extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
  276. /*
  277. * This name form shall be represented by the Object Identifier {iso(1)
  278. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  279. * generic(1) user_name(1)}. The recommended symbolic name for this
  280. * type is "GSS_KRB5_NT_USER_NAME".
  281. */
  282. extern gss_OID GSS_KRB5_NT_USER_NAME;
  283. /*
  284. * This name form shall be represented by the Object Identifier {iso(1)
  285. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  286. * generic(1) machine_uid_name(2)}. The recommended symbolic name for
  287. * this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
  288. */
  289. extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
  290. /*
  291. * This name form shall be represented by the Object Identifier {iso(1)
  292. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  293. * generic(1) string_uid_name(3)}. The recommended symbolic name for
  294. * this type is "GSS_KRB5_NT_STRING_UID_NAME".
  295. */
  296. extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;
  297. /* Major status codes */
  298. #define GSS_S_COMPLETE 0
  299. /*
  300. * Some "helper" definitions to make the status code macros obvious.
  301. */
  302. #define GSS_C_CALLING_ERROR_OFFSET 24
  303. #define GSS_C_ROUTINE_ERROR_OFFSET 16
  304. #define GSS_C_SUPPLEMENTARY_OFFSET 0
  305. #define GSS_C_CALLING_ERROR_MASK 0377ul
  306. #define GSS_C_ROUTINE_ERROR_MASK 0377ul
  307. #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
  308. /*
  309. * The macros that test status codes for error conditions.
  310. * Note that the GSS_ERROR() macro has changed slightly from
  311. * the V1 GSS-API so that it now evaluates its argument
  312. * only once.
  313. */
  314. #define GSS_CALLING_ERROR(x) \
  315. (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
  316. #define GSS_ROUTINE_ERROR(x) \
  317. (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
  318. #define GSS_SUPPLEMENTARY_INFO(x) \
  319. (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
  320. #define GSS_ERROR(x) \
  321. (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
  322. (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
  323. /*
  324. * Now the actual status code definitions
  325. */
  326. /*
  327. * Calling errors:
  328. */
  329. #define GSS_S_CALL_INACCESSIBLE_READ \
  330. (1ul << GSS_C_CALLING_ERROR_OFFSET)
  331. #define GSS_S_CALL_INACCESSIBLE_WRITE \
  332. (2ul << GSS_C_CALLING_ERROR_OFFSET)
  333. #define GSS_S_CALL_BAD_STRUCTURE \
  334. (3ul << GSS_C_CALLING_ERROR_OFFSET)
  335. /*
  336. * Routine errors:
  337. */
  338. #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
  339. #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
  340. #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
  341. #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
  342. #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
  343. #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
  344. #define GSS_S_BAD_MIC GSS_S_BAD_SIG
  345. #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
  346. #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
  347. #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
  348. #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
  349. #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
  350. #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
  351. #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
  352. #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
  353. #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
  354. #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
  355. #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
  356. #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
  357. /*
  358. * Supplementary info bits:
  359. */
  360. #define GSS_S_CONTINUE_NEEDED \
  361. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
  362. #define GSS_S_DUPLICATE_TOKEN \
  363. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
  364. #define GSS_S_OLD_TOKEN \
  365. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
  366. #define GSS_S_UNSEQ_TOKEN \
  367. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
  368. #define GSS_S_GAP_TOKEN \
  369. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
  370. __BEGIN_DECLS
  371. /*
  372. * Finally, function prototypes for the GSS-API routines.
  373. */
  374. OM_uint32 gss_acquire_cred
  375. (OM_uint32 *, /* minor_status */
  376. const gss_name_t, /* desired_name */
  377. OM_uint32, /* time_req */
  378. const gss_OID_set, /* desired_mechs */
  379. gss_cred_usage_t, /* cred_usage */
  380. gss_cred_id_t *, /* output_cred_handle */
  381. gss_OID_set *, /* actual_mechs */
  382. OM_uint32 * /* time_rec */
  383. );
  384. OM_uint32 gss_release_cred
  385. (OM_uint32 *, /* minor_status */
  386. gss_cred_id_t * /* cred_handle */
  387. );
  388. OM_uint32 gss_init_sec_context
  389. (OM_uint32 *, /* minor_status */
  390. const gss_cred_id_t, /* initiator_cred_handle */
  391. gss_ctx_id_t *, /* context_handle */
  392. const gss_name_t, /* target_name */
  393. const gss_OID, /* mech_type */
  394. OM_uint32, /* req_flags */
  395. OM_uint32, /* time_req */
  396. const gss_channel_bindings_t,
  397. /* input_chan_bindings */
  398. const gss_buffer_t, /* input_token */
  399. gss_OID *, /* actual_mech_type */
  400. gss_buffer_t, /* output_token */
  401. OM_uint32 *, /* ret_flags */
  402. OM_uint32 * /* time_rec */
  403. );
  404. OM_uint32 gss_accept_sec_context
  405. (OM_uint32 *, /* minor_status */
  406. gss_ctx_id_t *, /* context_handle */
  407. const gss_cred_id_t, /* acceptor_cred_handle */
  408. const gss_buffer_t, /* input_token_buffer */
  409. const gss_channel_bindings_t,
  410. /* input_chan_bindings */
  411. gss_name_t *, /* src_name */
  412. gss_OID *, /* mech_type */
  413. gss_buffer_t, /* output_token */
  414. OM_uint32 *, /* ret_flags */
  415. OM_uint32 *, /* time_rec */
  416. gss_cred_id_t * /* delegated_cred_handle */
  417. );
  418. OM_uint32 gss_process_context_token
  419. (OM_uint32 *, /* minor_status */
  420. const gss_ctx_id_t, /* context_handle */
  421. const gss_buffer_t /* token_buffer */
  422. );
  423. OM_uint32 gss_delete_sec_context
  424. (OM_uint32 *, /* minor_status */
  425. gss_ctx_id_t *, /* context_handle */
  426. gss_buffer_t /* output_token */
  427. );
  428. OM_uint32 gss_context_time
  429. (OM_uint32 *, /* minor_status */
  430. const gss_ctx_id_t, /* context_handle */
  431. OM_uint32 * /* time_rec */
  432. );
  433. OM_uint32 gss_get_mic
  434. (OM_uint32 *, /* minor_status */
  435. const gss_ctx_id_t, /* context_handle */
  436. gss_qop_t, /* qop_req */
  437. const gss_buffer_t, /* message_buffer */
  438. gss_buffer_t /* message_token */
  439. );
  440. OM_uint32 gss_verify_mic
  441. (OM_uint32 *, /* minor_status */
  442. const gss_ctx_id_t, /* context_handle */
  443. const gss_buffer_t, /* message_buffer */
  444. const gss_buffer_t, /* token_buffer */
  445. gss_qop_t * /* qop_state */
  446. );
  447. OM_uint32 gss_wrap
  448. (OM_uint32 *, /* minor_status */
  449. const gss_ctx_id_t, /* context_handle */
  450. int, /* conf_req_flag */
  451. gss_qop_t, /* qop_req */
  452. const gss_buffer_t, /* input_message_buffer */
  453. int *, /* conf_state */
  454. gss_buffer_t /* output_message_buffer */
  455. );
  456. OM_uint32 gss_unwrap
  457. (OM_uint32 *, /* minor_status */
  458. const gss_ctx_id_t, /* context_handle */
  459. const gss_buffer_t, /* input_message_buffer */
  460. gss_buffer_t, /* output_message_buffer */
  461. int *, /* conf_state */
  462. gss_qop_t * /* qop_state */
  463. );
  464. OM_uint32 gss_display_status
  465. (OM_uint32 *, /* minor_status */
  466. OM_uint32, /* status_value */
  467. int, /* status_type */
  468. const gss_OID, /* mech_type */
  469. OM_uint32 *, /* message_context */
  470. gss_buffer_t /* status_string */
  471. );
  472. OM_uint32 gss_indicate_mechs
  473. (OM_uint32 *, /* minor_status */
  474. gss_OID_set * /* mech_set */
  475. );
  476. OM_uint32 gss_compare_name
  477. (OM_uint32 *, /* minor_status */
  478. const gss_name_t, /* name1 */
  479. const gss_name_t, /* name2 */
  480. int * /* name_equal */
  481. );
  482. OM_uint32 gss_display_name
  483. (OM_uint32 *, /* minor_status */
  484. const gss_name_t, /* input_name */
  485. gss_buffer_t, /* output_name_buffer */
  486. gss_OID * /* output_name_type */
  487. );
  488. OM_uint32 gss_import_name
  489. (OM_uint32 *, /* minor_status */
  490. const gss_buffer_t, /* input_name_buffer */
  491. const gss_OID, /* input_name_type */
  492. gss_name_t * /* output_name */
  493. );
  494. OM_uint32 gss_export_name
  495. (OM_uint32 *, /* minor_status */
  496. const gss_name_t, /* input_name */
  497. gss_buffer_t /* exported_name */
  498. );
  499. OM_uint32 gss_release_name
  500. (OM_uint32 *, /* minor_status */
  501. gss_name_t * /* input_name */
  502. );
  503. OM_uint32 gss_release_buffer
  504. (OM_uint32 *, /* minor_status */
  505. gss_buffer_t /* buffer */
  506. );
  507. OM_uint32 gss_release_oid_set
  508. (OM_uint32 *, /* minor_status */
  509. gss_OID_set * /* set */
  510. );
  511. OM_uint32 gss_inquire_cred
  512. (OM_uint32 *, /* minor_status */
  513. const gss_cred_id_t, /* cred_handle */
  514. gss_name_t *, /* name */
  515. OM_uint32 *, /* lifetime */
  516. gss_cred_usage_t *, /* cred_usage */
  517. gss_OID_set * /* mechanisms */
  518. );
  519. OM_uint32 gss_inquire_context (
  520. OM_uint32 *, /* minor_status */
  521. const gss_ctx_id_t, /* context_handle */
  522. gss_name_t *, /* src_name */
  523. gss_name_t *, /* targ_name */
  524. OM_uint32 *, /* lifetime_rec */
  525. gss_OID *, /* mech_type */
  526. OM_uint32 *, /* ctx_flags */
  527. int *, /* locally_initiated */
  528. int * /* open */
  529. );
  530. OM_uint32 gss_wrap_size_limit (
  531. OM_uint32 *, /* minor_status */
  532. const gss_ctx_id_t, /* context_handle */
  533. int, /* conf_req_flag */
  534. gss_qop_t, /* qop_req */
  535. OM_uint32, /* req_output_size */
  536. OM_uint32 * /* max_input_size */
  537. );
  538. OM_uint32 gss_add_cred (
  539. OM_uint32 *, /* minor_status */
  540. const gss_cred_id_t, /* input_cred_handle */
  541. const gss_name_t, /* desired_name */
  542. const gss_OID, /* desired_mech */
  543. gss_cred_usage_t, /* cred_usage */
  544. OM_uint32, /* initiator_time_req */
  545. OM_uint32, /* acceptor_time_req */
  546. gss_cred_id_t *, /* output_cred_handle */
  547. gss_OID_set *, /* actual_mechs */
  548. OM_uint32 *, /* initiator_time_rec */
  549. OM_uint32 * /* acceptor_time_rec */
  550. );
  551. OM_uint32 gss_inquire_cred_by_mech (
  552. OM_uint32 *, /* minor_status */
  553. const gss_cred_id_t, /* cred_handle */
  554. const gss_OID, /* mech_type */
  555. gss_name_t *, /* name */
  556. OM_uint32 *, /* initiator_lifetime */
  557. OM_uint32 *, /* acceptor_lifetime */
  558. gss_cred_usage_t * /* cred_usage */
  559. );
  560. OM_uint32 gss_export_sec_context (
  561. OM_uint32 *, /* minor_status */
  562. gss_ctx_id_t *, /* context_handle */
  563. gss_buffer_t /* interprocess_token */
  564. );
  565. OM_uint32 gss_import_sec_context (
  566. OM_uint32 *, /* minor_status */
  567. const gss_buffer_t, /* interprocess_token */
  568. gss_ctx_id_t * /* context_handle */
  569. );
  570. OM_uint32 gss_create_empty_oid_set (
  571. OM_uint32 *, /* minor_status */
  572. gss_OID_set * /* oid_set */
  573. );
  574. OM_uint32 gss_add_oid_set_member (
  575. OM_uint32 *, /* minor_status */
  576. const gss_OID, /* member_oid */
  577. gss_OID_set * /* oid_set */
  578. );
  579. OM_uint32 gss_test_oid_set_member (
  580. OM_uint32 *, /* minor_status */
  581. const gss_OID, /* member */
  582. const gss_OID_set, /* set */
  583. int * /* present */
  584. );
  585. OM_uint32 gss_inquire_names_for_mech (
  586. OM_uint32 *, /* minor_status */
  587. const gss_OID, /* mechanism */
  588. gss_OID_set * /* name_types */
  589. );
  590. OM_uint32 gss_inquire_mechs_for_name (
  591. OM_uint32 *, /* minor_status */
  592. const gss_name_t, /* input_name */
  593. gss_OID_set * /* mech_types */
  594. );
  595. OM_uint32 gss_canonicalize_name (
  596. OM_uint32 *, /* minor_status */
  597. const gss_name_t, /* input_name */
  598. const gss_OID, /* mech_type */
  599. gss_name_t * /* output_name */
  600. );
  601. OM_uint32 gss_duplicate_name (
  602. OM_uint32 *, /* minor_status */
  603. const gss_name_t, /* src_name */
  604. gss_name_t * /* dest_name */
  605. );
  606. /*
  607. * The following routines are obsolete variants of gss_get_mic,
  608. * gss_verify_mic, gss_wrap and gss_unwrap. They should be
  609. * provided by GSS-API V2 implementations for backwards
  610. * compatibility with V1 applications. Distinct entrypoints
  611. * (as opposed to #defines) should be provided, both to allow
  612. * GSS-API V1 applications to link against GSS-API V2 implementations,
  613. * and to retain the slight parameter type differences between the
  614. * obsolete versions of these routines and their current forms.
  615. */
  616. OM_uint32 gss_sign
  617. (OM_uint32 *, /* minor_status */
  618. gss_ctx_id_t, /* context_handle */
  619. int, /* qop_req */
  620. gss_buffer_t, /* message_buffer */
  621. gss_buffer_t /* message_token */
  622. );
  623. OM_uint32 gss_verify
  624. (OM_uint32 *, /* minor_status */
  625. gss_ctx_id_t, /* context_handle */
  626. gss_buffer_t, /* message_buffer */
  627. gss_buffer_t, /* token_buffer */
  628. int * /* qop_state */
  629. );
  630. OM_uint32 gss_seal
  631. (OM_uint32 *, /* minor_status */
  632. gss_ctx_id_t, /* context_handle */
  633. int, /* conf_req_flag */
  634. int, /* qop_req */
  635. gss_buffer_t, /* input_message_buffer */
  636. int *, /* conf_state */
  637. gss_buffer_t /* output_message_buffer */
  638. );
  639. OM_uint32 gss_unseal
  640. (OM_uint32 *, /* minor_status */
  641. gss_ctx_id_t, /* context_handle */
  642. gss_buffer_t, /* input_message_buffer */
  643. gss_buffer_t, /* output_message_buffer */
  644. int *, /* conf_state */
  645. int * /* qop_state */
  646. );
  647. /*
  648. * Other extensions and helper functions.
  649. */
  650. int gss_oid_equal
  651. (const gss_OID, /* first OID to compare */
  652. const gss_OID /* second OID to compare */
  653. );
  654. OM_uint32 gss_release_oid
  655. (OM_uint32 *, /* minor status */
  656. gss_OID * /* oid to free */
  657. );
  658. OM_uint32 gss_decapsulate_token
  659. (const gss_buffer_t, /* mechanism independent token */
  660. gss_OID, /* desired mechanism */
  661. gss_buffer_t /* decapsulated mechanism dependent token */
  662. );
  663. OM_uint32 gss_encapsulate_token
  664. (const gss_buffer_t, /* mechanism dependent token */
  665. gss_OID, /* desired mechanism */
  666. gss_buffer_t /* encapsulated mechanism independent token */
  667. );
  668. OM_uint32 gss_duplicate_oid
  669. (OM_uint32 *, /* minor status */
  670. const gss_OID, /* oid to copy */
  671. gss_OID * /* result */
  672. );
  673. OM_uint32 gss_oid_to_str
  674. (OM_uint32 *, /* minor status */
  675. gss_OID, /* oid to convert */
  676. gss_buffer_t /* buffer to contain string */
  677. );
  678. typedef struct gss_buffer_set_desc_struct {
  679. size_t count;
  680. gss_buffer_desc *elements;
  681. } gss_buffer_set_desc, *gss_buffer_set_t;
  682. #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
  683. OM_uint32 gss_create_empty_buffer_set
  684. (OM_uint32 *, /* minor status */
  685. gss_buffer_set_t * /* location for new buffer set */
  686. );
  687. OM_uint32 gss_add_buffer_set_member
  688. (OM_uint32 *, /* minor status */
  689. gss_buffer_t, /* buffer to add */
  690. gss_buffer_set_t * /* set to add to */
  691. );
  692. OM_uint32 gss_release_buffer_set
  693. (OM_uint32 *, /* minor status */
  694. gss_buffer_set_t * /* set to release */
  695. );
  696. OM_uint32 gss_inquire_sec_context_by_oid
  697. (OM_uint32 *, /* minor_status */
  698. const gss_ctx_id_t, /* context_handle */
  699. const gss_OID, /* desired_object */
  700. gss_buffer_set_t * /* result */
  701. );
  702. OM_uint32 gss_inquire_cred_by_oid
  703. (OM_uint32 *, /* minor_status */
  704. const gss_cred_id_t, /* cred_handle */
  705. const gss_OID, /* desired_object */
  706. gss_buffer_set_t * /* result */
  707. );
  708. OM_uint32 gss_set_sec_context_option
  709. (OM_uint32 *, /* minor status */
  710. gss_ctx_id_t *, /* context */
  711. const gss_OID, /* option to set */
  712. const gss_buffer_t /* option value */
  713. );
  714. OM_uint32 gss_set_cred_option
  715. (OM_uint32 *, /* minor status */
  716. gss_cred_id_t *, /* cred */
  717. const gss_OID, /* option to set */
  718. const gss_buffer_t /* option value */
  719. );
  720. OM_uint32 gss_pseudo_random
  721. (OM_uint32 *, /* minor status */
  722. gss_ctx_id_t, /* context handle */
  723. int prf_key, /* XXX */
  724. const gss_buffer_t, /* data to seed generator */
  725. ssize_t, /* amount of data required */
  726. gss_buffer_t /* buffer for result */
  727. );
  728. #ifdef _UID_T_DECLARED
  729. OM_uint32 gss_pname_to_uid
  730. (OM_uint32 *, /* minor status */
  731. const gss_name_t pname, /* principal name */
  732. const gss_OID mech, /* mechanism to query */
  733. uid_t *uidp /* pointer to UID for result */
  734. );
  735. #endif
  736. __END_DECLS
  737. #endif /* _GSSAPI_GSSAPI_H_ */