gssapi.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  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. #ifndef _KGSSAPI_GSSAPI_H_
  29. #define _KGSSAPI_GSSAPI_H_
  30. /*
  31. * A cut-down version of the GSS-API for in-kernel use
  32. */
  33. /*
  34. * Now define the three implementation-dependent types.
  35. */
  36. typedef struct _gss_ctx_id_t *gss_ctx_id_t;
  37. typedef struct _gss_cred_id_t *gss_cred_id_t;
  38. typedef struct _gss_name_t *gss_name_t;
  39. /*
  40. * We can't use X/Open definitions, so roll our own.
  41. */
  42. typedef uint32_t OM_uint32;
  43. typedef uint64_t OM_uint64;
  44. typedef struct gss_OID_desc_struct {
  45. OM_uint32 length;
  46. void *elements;
  47. } gss_OID_desc, *gss_OID;
  48. typedef struct gss_OID_set_desc_struct {
  49. size_t count;
  50. gss_OID elements;
  51. } gss_OID_set_desc, *gss_OID_set;
  52. typedef struct gss_buffer_desc_struct {
  53. size_t length;
  54. void *value;
  55. } gss_buffer_desc, *gss_buffer_t;
  56. typedef struct gss_channel_bindings_struct {
  57. OM_uint32 initiator_addrtype;
  58. gss_buffer_desc initiator_address;
  59. OM_uint32 acceptor_addrtype;
  60. gss_buffer_desc acceptor_address;
  61. gss_buffer_desc application_data;
  62. } *gss_channel_bindings_t;
  63. /*
  64. * For now, define a QOP-type as an OM_uint32
  65. */
  66. typedef OM_uint32 gss_qop_t;
  67. typedef int gss_cred_usage_t;
  68. /*
  69. * Flag bits for context-level services.
  70. */
  71. #define GSS_C_DELEG_FLAG 1
  72. #define GSS_C_MUTUAL_FLAG 2
  73. #define GSS_C_REPLAY_FLAG 4
  74. #define GSS_C_SEQUENCE_FLAG 8
  75. #define GSS_C_CONF_FLAG 16
  76. #define GSS_C_INTEG_FLAG 32
  77. #define GSS_C_ANON_FLAG 64
  78. #define GSS_C_PROT_READY_FLAG 128
  79. #define GSS_C_TRANS_FLAG 256
  80. /*
  81. * Credential usage options
  82. */
  83. #define GSS_C_BOTH 0
  84. #define GSS_C_INITIATE 1
  85. #define GSS_C_ACCEPT 2
  86. /*
  87. * Status code types for gss_display_status
  88. */
  89. #define GSS_C_GSS_CODE 1
  90. #define GSS_C_MECH_CODE 2
  91. /*
  92. * The constant definitions for channel-bindings address families
  93. */
  94. #define GSS_C_AF_UNSPEC 0
  95. #define GSS_C_AF_LOCAL 1
  96. #define GSS_C_AF_INET 2
  97. #define GSS_C_AF_IMPLINK 3
  98. #define GSS_C_AF_PUP 4
  99. #define GSS_C_AF_CHAOS 5
  100. #define GSS_C_AF_NS 6
  101. #define GSS_C_AF_NBS 7
  102. #define GSS_C_AF_ECMA 8
  103. #define GSS_C_AF_DATAKIT 9
  104. #define GSS_C_AF_CCITT 10
  105. #define GSS_C_AF_SNA 11
  106. #define GSS_C_AF_DECnet 12
  107. #define GSS_C_AF_DLI 13
  108. #define GSS_C_AF_LAT 14
  109. #define GSS_C_AF_HYLINK 15
  110. #define GSS_C_AF_APPLETALK 16
  111. #define GSS_C_AF_BSC 17
  112. #define GSS_C_AF_DSS 18
  113. #define GSS_C_AF_OSI 19
  114. #define GSS_C_AF_X25 21
  115. #define GSS_C_AF_NULLADDR 255
  116. /*
  117. * Various Null values
  118. */
  119. #define GSS_C_NO_NAME ((gss_name_t) 0)
  120. #define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
  121. #define GSS_C_NO_OID ((gss_OID) 0)
  122. #define GSS_C_NO_OID_SET ((gss_OID_set) 0)
  123. #define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
  124. #define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
  125. #define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
  126. #define GSS_C_EMPTY_BUFFER {0, NULL}
  127. /*
  128. * Some alternate names for a couple of the above
  129. * values. These are defined for V1 compatibility.
  130. */
  131. #define GSS_C_NULL_OID GSS_C_NO_OID
  132. #define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
  133. /*
  134. * Define the default Quality of Protection for per-message
  135. * services. Note that an implementation that offers multiple
  136. * levels of QOP may define GSS_C_QOP_DEFAULT to be either zero
  137. * (as done here) to mean "default protection", or to a specific
  138. * explicit QOP value. However, a value of 0 should always be
  139. * interpreted by a GSS-API implementation as a request for the
  140. * default protection level.
  141. */
  142. #define GSS_C_QOP_DEFAULT 0
  143. /*
  144. * Expiration time of 2^32-1 seconds means infinite lifetime for a
  145. * credential or security context
  146. */
  147. #define GSS_C_INDEFINITE 0xfffffffful
  148. /*
  149. * The implementation must reserve static storage for a
  150. * gss_OID_desc object containing the value
  151. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  152. * "\x01\x02\x01\x01"},
  153. * corresponding to an object-identifier value of
  154. * {iso(1) member-body(2) United States(840) mit(113554)
  155. * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
  156. * GSS_C_NT_USER_NAME should be initialized to point
  157. * to that gss_OID_desc.
  158. */
  159. extern gss_OID GSS_C_NT_USER_NAME;
  160. /*
  161. * The implementation must reserve static storage for a
  162. * gss_OID_desc object containing the value
  163. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  164. * "\x01\x02\x01\x02"},
  165. * corresponding to an object-identifier value of
  166. * {iso(1) member-body(2) United States(840) mit(113554)
  167. * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
  168. * The constant GSS_C_NT_MACHINE_UID_NAME should be
  169. * initialized to point to that gss_OID_desc.
  170. */
  171. extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
  172. /*
  173. * The implementation must reserve static storage for a
  174. * gss_OID_desc object containing the value
  175. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  176. * "\x01\x02\x01\x03"},
  177. * corresponding to an object-identifier value of
  178. * {iso(1) member-body(2) United States(840) mit(113554)
  179. * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
  180. * The constant GSS_C_NT_STRING_UID_NAME should be
  181. * initialized to point to that gss_OID_desc.
  182. */
  183. extern gss_OID GSS_C_NT_STRING_UID_NAME;
  184. /*
  185. * The implementation must reserve static storage for a
  186. * gss_OID_desc object containing the value
  187. * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
  188. * corresponding to an object-identifier value of
  189. * {iso(1) org(3) dod(6) internet(1) security(5)
  190. * nametypes(6) gss-host-based-services(2)). The constant
  191. * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
  192. * to that gss_OID_desc. This is a deprecated OID value, and
  193. * implementations wishing to support hostbased-service names
  194. * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
  195. * defined below, to identify such names;
  196. * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
  197. * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
  198. * parameter, but should not be emitted by GSS-API
  199. * implementations
  200. */
  201. extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
  202. /*
  203. * The implementation must reserve static storage for a
  204. * gss_OID_desc object containing the value
  205. * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
  206. * "\x01\x02\x01\x04"}, corresponding to an
  207. * object-identifier value of {iso(1) member-body(2)
  208. * Unites States(840) mit(113554) infosys(1) gssapi(2)
  209. * generic(1) service_name(4)}. The constant
  210. * GSS_C_NT_HOSTBASED_SERVICE should be initialized
  211. * to point to that gss_OID_desc.
  212. */
  213. extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
  214. /*
  215. * The implementation must reserve static storage for a
  216. * gss_OID_desc object containing the value
  217. * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
  218. * corresponding to an object identifier value of
  219. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  220. * 6(nametypes), 3(gss-anonymous-name)}. The constant
  221. * and GSS_C_NT_ANONYMOUS should be initialized to point
  222. * to that gss_OID_desc.
  223. */
  224. extern gss_OID GSS_C_NT_ANONYMOUS;
  225. /*
  226. * The implementation must reserve static storage for a
  227. * gss_OID_desc object containing the value
  228. * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
  229. * corresponding to an object-identifier value of
  230. * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
  231. * 6(nametypes), 4(gss-api-exported-name)}. The constant
  232. * GSS_C_NT_EXPORT_NAME should be initialized to point
  233. * to that gss_OID_desc.
  234. */
  235. extern gss_OID GSS_C_NT_EXPORT_NAME;
  236. /*
  237. * This name form shall be represented by the Object Identifier {iso(1)
  238. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  239. * krb5(2) krb5_name(1)}. The recommended symbolic name for this type
  240. * is "GSS_KRB5_NT_PRINCIPAL_NAME".
  241. */
  242. extern gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
  243. /*
  244. * This name form shall be represented by the Object Identifier {iso(1)
  245. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  246. * generic(1) user_name(1)}. The recommended symbolic name for this
  247. * type is "GSS_KRB5_NT_USER_NAME".
  248. */
  249. extern gss_OID GSS_KRB5_NT_USER_NAME;
  250. /*
  251. * This name form shall be represented by the Object Identifier {iso(1)
  252. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  253. * generic(1) machine_uid_name(2)}. The recommended symbolic name for
  254. * this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
  255. */
  256. extern gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
  257. /*
  258. * This name form shall be represented by the Object Identifier {iso(1)
  259. * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
  260. * generic(1) string_uid_name(3)}. The recommended symbolic name for
  261. * this type is "GSS_KRB5_NT_STRING_UID_NAME".
  262. */
  263. extern gss_OID GSS_KRB5_NT_STRING_UID_NAME;
  264. /* Major status codes */
  265. #define GSS_S_COMPLETE 0
  266. /*
  267. * Some "helper" definitions to make the status code macros obvious.
  268. */
  269. #define GSS_C_CALLING_ERROR_OFFSET 24
  270. #define GSS_C_ROUTINE_ERROR_OFFSET 16
  271. #define GSS_C_SUPPLEMENTARY_OFFSET 0
  272. #define GSS_C_CALLING_ERROR_MASK 0377ul
  273. #define GSS_C_ROUTINE_ERROR_MASK 0377ul
  274. #define GSS_C_SUPPLEMENTARY_MASK 0177777ul
  275. /*
  276. * The macros that test status codes for error conditions.
  277. * Note that the GSS_ERROR() macro has changed slightly from
  278. * the V1 GSS-API so that it now evaluates its argument
  279. * only once.
  280. */
  281. #define GSS_CALLING_ERROR(x) \
  282. (x & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
  283. #define GSS_ROUTINE_ERROR(x) \
  284. (x & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
  285. #define GSS_SUPPLEMENTARY_INFO(x) \
  286. (x & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
  287. #define GSS_ERROR(x) \
  288. (x & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
  289. (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
  290. /*
  291. * Now the actual status code definitions
  292. */
  293. /*
  294. * Calling errors:
  295. */
  296. #define GSS_S_CALL_INACCESSIBLE_READ \
  297. (1ul << GSS_C_CALLING_ERROR_OFFSET)
  298. #define GSS_S_CALL_INACCESSIBLE_WRITE \
  299. (2ul << GSS_C_CALLING_ERROR_OFFSET)
  300. #define GSS_S_CALL_BAD_STRUCTURE \
  301. (3ul << GSS_C_CALLING_ERROR_OFFSET)
  302. /*
  303. * Routine errors:
  304. */
  305. #define GSS_S_BAD_MECH (1ul << GSS_C_ROUTINE_ERROR_OFFSET)
  306. #define GSS_S_BAD_NAME (2ul << GSS_C_ROUTINE_ERROR_OFFSET)
  307. #define GSS_S_BAD_NAMETYPE (3ul << GSS_C_ROUTINE_ERROR_OFFSET)
  308. #define GSS_S_BAD_BINDINGS (4ul << GSS_C_ROUTINE_ERROR_OFFSET)
  309. #define GSS_S_BAD_STATUS (5ul << GSS_C_ROUTINE_ERROR_OFFSET)
  310. #define GSS_S_BAD_SIG (6ul << GSS_C_ROUTINE_ERROR_OFFSET)
  311. #define GSS_S_BAD_MIC GSS_S_BAD_SIG
  312. #define GSS_S_NO_CRED (7ul << GSS_C_ROUTINE_ERROR_OFFSET)
  313. #define GSS_S_NO_CONTEXT (8ul << GSS_C_ROUTINE_ERROR_OFFSET)
  314. #define GSS_S_DEFECTIVE_TOKEN (9ul << GSS_C_ROUTINE_ERROR_OFFSET)
  315. #define GSS_S_DEFECTIVE_CREDENTIAL (10ul << GSS_C_ROUTINE_ERROR_OFFSET)
  316. #define GSS_S_CREDENTIALS_EXPIRED (11ul << GSS_C_ROUTINE_ERROR_OFFSET)
  317. #define GSS_S_CONTEXT_EXPIRED (12ul << GSS_C_ROUTINE_ERROR_OFFSET)
  318. #define GSS_S_FAILURE (13ul << GSS_C_ROUTINE_ERROR_OFFSET)
  319. #define GSS_S_BAD_QOP (14ul << GSS_C_ROUTINE_ERROR_OFFSET)
  320. #define GSS_S_UNAUTHORIZED (15ul << GSS_C_ROUTINE_ERROR_OFFSET)
  321. #define GSS_S_UNAVAILABLE (16ul << GSS_C_ROUTINE_ERROR_OFFSET)
  322. #define GSS_S_DUPLICATE_ELEMENT (17ul << GSS_C_ROUTINE_ERROR_OFFSET)
  323. #define GSS_S_NAME_NOT_MN (18ul << GSS_C_ROUTINE_ERROR_OFFSET)
  324. /*
  325. * Supplementary info bits:
  326. */
  327. #define GSS_S_CONTINUE_NEEDED \
  328. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
  329. #define GSS_S_DUPLICATE_TOKEN \
  330. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
  331. #define GSS_S_OLD_TOKEN \
  332. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
  333. #define GSS_S_UNSEQ_TOKEN \
  334. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
  335. #define GSS_S_GAP_TOKEN \
  336. (1ul << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
  337. /*
  338. * NI_MAXSERV and NI_MAXHOST. The srv_principal argument for
  339. * rpc_gss_ip_to_srv_principal should point to at least
  340. * NI_MAXSERV + NI_MAXHOST + 1 bytes of storage. The "+ 1" is for the '@'.
  341. * The NI_MAXHOST limit is checked for gss_ip_to_dns().
  342. * These should be set to the same value as they are in <netdb.h>.
  343. */
  344. #ifndef NI_MAXHOST
  345. #define NI_MAXSERV 32
  346. #define NI_MAXHOST 1025
  347. #endif
  348. __BEGIN_DECLS
  349. /*
  350. * Finally, function prototypes for the GSS-API routines.
  351. */
  352. OM_uint32 gss_acquire_cred
  353. (OM_uint32 *, /* minor_status */
  354. const gss_name_t, /* desired_name */
  355. OM_uint32, /* time_req */
  356. const gss_OID_set, /* desired_mechs */
  357. gss_cred_usage_t, /* cred_usage */
  358. gss_cred_id_t *, /* output_cred_handle */
  359. gss_OID_set *, /* actual_mechs */
  360. OM_uint32 * /* time_rec */
  361. );
  362. OM_uint32 gss_release_cred
  363. (OM_uint32 *, /* minor_status */
  364. gss_cred_id_t * /* cred_handle */
  365. );
  366. OM_uint32 gss_init_sec_context
  367. (OM_uint32 *, /* minor_status */
  368. const gss_cred_id_t, /* initiator_cred_handle */
  369. gss_ctx_id_t *, /* context_handle */
  370. const gss_name_t, /* target_name */
  371. const gss_OID, /* mech_type */
  372. OM_uint32, /* req_flags */
  373. OM_uint32, /* time_req */
  374. const gss_channel_bindings_t,
  375. /* input_chan_bindings */
  376. const gss_buffer_t, /* input_token */
  377. gss_OID *, /* actual_mech_type */
  378. gss_buffer_t, /* output_token */
  379. OM_uint32 *, /* ret_flags */
  380. OM_uint32 * /* time_rec */
  381. );
  382. OM_uint32 gss_accept_sec_context
  383. (OM_uint32 *, /* minor_status */
  384. gss_ctx_id_t *, /* context_handle */
  385. const gss_cred_id_t, /* acceptor_cred_handle */
  386. const gss_buffer_t, /* input_token_buffer */
  387. const gss_channel_bindings_t,
  388. /* input_chan_bindings */
  389. gss_name_t *, /* src_name */
  390. gss_OID *, /* mech_type */
  391. gss_buffer_t, /* output_token */
  392. OM_uint32 *, /* ret_flags */
  393. OM_uint32 *, /* time_rec */
  394. gss_cred_id_t * /* delegated_cred_handle */
  395. );
  396. OM_uint32 gss_delete_sec_context
  397. (OM_uint32 *, /* minor_status */
  398. gss_ctx_id_t *, /* context_handle */
  399. gss_buffer_t /* output_token */
  400. );
  401. OM_uint32 gss_get_mic
  402. (OM_uint32 *, /* minor_status */
  403. const gss_ctx_id_t, /* context_handle */
  404. gss_qop_t, /* qop_req */
  405. const gss_buffer_t, /* message_buffer */
  406. gss_buffer_t /* message_token */
  407. );
  408. OM_uint32 gss_verify_mic
  409. (OM_uint32 *, /* minor_status */
  410. const gss_ctx_id_t, /* context_handle */
  411. const gss_buffer_t, /* message_buffer */
  412. const gss_buffer_t, /* token_buffer */
  413. gss_qop_t * /* qop_state */
  414. );
  415. OM_uint32 gss_wrap
  416. (OM_uint32 *, /* minor_status */
  417. const gss_ctx_id_t, /* context_handle */
  418. int, /* conf_req_flag */
  419. gss_qop_t, /* qop_req */
  420. const gss_buffer_t, /* input_message_buffer */
  421. int *, /* conf_state */
  422. gss_buffer_t /* output_message_buffer */
  423. );
  424. OM_uint32 gss_unwrap
  425. (OM_uint32 *, /* minor_status */
  426. const gss_ctx_id_t, /* context_handle */
  427. const gss_buffer_t, /* input_message_buffer */
  428. gss_buffer_t, /* output_message_buffer */
  429. int *, /* conf_state */
  430. gss_qop_t * /* qop_state */
  431. );
  432. OM_uint32 gss_display_status
  433. (OM_uint32 *, /* minor_status */
  434. OM_uint32, /* status_value */
  435. int, /* status_type */
  436. const gss_OID, /* mech_type */
  437. OM_uint32 *, /* message_context */
  438. gss_buffer_t /* status_string */
  439. );
  440. OM_uint32 gss_import_name
  441. (OM_uint32 *, /* minor_status */
  442. const gss_buffer_t, /* input_name_buffer */
  443. const gss_OID, /* input_name_type */
  444. gss_name_t * /* output_name */
  445. );
  446. OM_uint32 gss_export_name
  447. (OM_uint32 *, /* minor_status */
  448. const gss_name_t, /* input_name */
  449. gss_buffer_t /* exported_name */
  450. );
  451. OM_uint32 gss_release_name
  452. (OM_uint32 *, /* minor_status */
  453. gss_name_t * /* input_name */
  454. );
  455. OM_uint32 gss_release_buffer
  456. (OM_uint32 *, /* minor_status */
  457. gss_buffer_t /* buffer */
  458. );
  459. OM_uint32 gss_release_oid_set
  460. (OM_uint32 *, /* minor_status */
  461. gss_OID_set * /* set */
  462. );
  463. OM_uint32 gss_wrap_size_limit (
  464. OM_uint32 *, /* minor_status */
  465. const gss_ctx_id_t, /* context_handle */
  466. int, /* conf_req_flag */
  467. gss_qop_t, /* qop_req */
  468. OM_uint32, /* req_output_size */
  469. OM_uint32 * /* max_input_size */
  470. );
  471. OM_uint32 gss_create_empty_oid_set (
  472. OM_uint32 *, /* minor_status */
  473. gss_OID_set * /* oid_set */
  474. );
  475. OM_uint32 gss_add_oid_set_member (
  476. OM_uint32 *, /* minor_status */
  477. const gss_OID, /* member_oid */
  478. gss_OID_set * /* oid_set */
  479. );
  480. OM_uint32 gss_test_oid_set_member (
  481. OM_uint32 *, /* minor_status */
  482. const gss_OID, /* member */
  483. const gss_OID_set, /* set */
  484. int * /* present */
  485. );
  486. OM_uint32 gss_canonicalize_name (
  487. OM_uint32 *, /* minor_status */
  488. const gss_name_t, /* input_name */
  489. const gss_OID, /* mech_type */
  490. gss_name_t * /* output_name */
  491. );
  492. /*
  493. * Other extensions and helper functions.
  494. */
  495. OM_uint32 gss_set_cred_option
  496. (OM_uint32 *, /* minor status */
  497. gss_cred_id_t *, /* cred */
  498. const gss_OID, /* option to set */
  499. const gss_buffer_t /* option value */
  500. );
  501. OM_uint32 gss_pname_to_uid
  502. (OM_uint32 *, /* minor status */
  503. const gss_name_t pname, /* principal name */
  504. const gss_OID mech, /* mechanism to query */
  505. uid_t *uidp /* pointer to UID for result */
  506. );
  507. /*
  508. * On entry, *numgroups is set to the maximum number of groups to return. On exit, *numgroups is set to the actual number of groups returned.
  509. */
  510. OM_uint32 gss_pname_to_unix_cred
  511. (OM_uint32 *, /* minor status */
  512. const gss_name_t pname, /* principal name */
  513. const gss_OID mech, /* mechanism to query */
  514. uid_t *uidp, /* pointer to UID for result */
  515. gid_t *gidp, /* pointer to GID for result */
  516. int *numgroups, /* number of groups */
  517. gid_t *groups /* pointer to group list */
  518. );
  519. OM_uint32 gss_ip_to_dns
  520. (OM_uint32 *, /* minor status */
  521. char *ip_addr, /* IP host address string */
  522. char *dns_name /* pointer to dns_name for result */
  523. );
  524. /*
  525. * Mbuf oriented message signing and encryption.
  526. *
  527. * Get_mic allocates an mbuf to hold the message checksum. Verify_mic
  528. * may modify the passed-in mic but will not free it.
  529. *
  530. * Wrap and unwrap
  531. * consume the message and generate a new mbuf chain with the
  532. * result. The original message is freed on error.
  533. */
  534. struct mbuf;
  535. OM_uint32 gss_get_mic_mbuf
  536. (OM_uint32 *, /* minor_status */
  537. const gss_ctx_id_t, /* context_handle */
  538. gss_qop_t, /* qop_req */
  539. struct mbuf *, /* message_buffer */
  540. struct mbuf ** /* message_token */
  541. );
  542. OM_uint32 gss_verify_mic_mbuf
  543. (OM_uint32 *, /* minor_status */
  544. const gss_ctx_id_t, /* context_handle */
  545. struct mbuf *, /* message_buffer */
  546. struct mbuf *, /* token_buffer */
  547. gss_qop_t * /* qop_state */
  548. );
  549. OM_uint32 gss_wrap_mbuf
  550. (OM_uint32 *, /* minor_status */
  551. const gss_ctx_id_t, /* context_handle */
  552. int, /* conf_req_flag */
  553. gss_qop_t, /* qop_req */
  554. struct mbuf **, /* message_buffer */
  555. int * /* conf_state */
  556. );
  557. OM_uint32 gss_unwrap_mbuf
  558. (OM_uint32 *, /* minor_status */
  559. const gss_ctx_id_t, /* context_handle */
  560. struct mbuf **, /* message_buffer */
  561. int *, /* conf_state */
  562. gss_qop_t * /* qop_state */
  563. );
  564. __END_DECLS
  565. #endif /* _KGSSAPI_GSSAPI_H_ */