gssapi_ext.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. /*
  2. * Copyright 2008 by the Massachusetts Institute of Technology.
  3. * All Rights Reserved.
  4. *
  5. * Export of this software from the United States of America may
  6. * require a specific license from the United States Government.
  7. * It is the responsibility of any person or organization contemplating
  8. * export to obtain such a license before exporting.
  9. *
  10. * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
  11. * distribute this software and its documentation for any purpose and
  12. * without fee is hereby granted, provided that the above copyright
  13. * notice appear in all copies and that both that copyright notice and
  14. * this permission notice appear in supporting documentation, and that
  15. * the name of M.I.T. not be used in advertising or publicity pertaining
  16. * to distribution of the software without specific, written prior
  17. * permission. Furthermore if you modify this software you must label
  18. * your software as modified software and not distribute it in such a
  19. * fashion that it might be confused with the original M.I.T. software.
  20. * M.I.T. makes no representations about the suitability of
  21. * this software for any purpose. It is provided "as is" without express
  22. * or implied warranty.
  23. */
  24. #ifndef GSSAPI_EXT_H_
  25. #define GSSAPI_EXT_H_
  26. #include <gssapi/gssapi.h>
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif /* __cplusplus */
  30. /*
  31. * Solaris extensions
  32. */
  33. #ifndef _WIN32
  34. OM_uint32 KRB5_CALLCONV
  35. gss_pname_to_uid
  36. (OM_uint32 *minor,
  37. const gss_name_t name,
  38. const gss_OID mech_type,
  39. uid_t *uidOut);
  40. #endif
  41. /**
  42. * Provides a platform-specific name for a GSSAPI name as interpreted by a
  43. * given mechanism.
  44. *
  45. * @param [out] minor Minor status code
  46. * @param [in] name The gss name resulting from accept_sec_context
  47. * @param [in] mech_type The mechanism that will be asked to map @a name to a
  48. * local name
  49. * @param [out] localname Caller-allocated buffer to be filled in with the
  50. * local name on success
  51. */
  52. OM_uint32 KRB5_CALLCONV
  53. gss_localname
  54. (OM_uint32 *minor,
  55. const gss_name_t name,
  56. gss_const_OID mech_type,
  57. gss_buffer_t localname);
  58. /**
  59. * Determine whether a mechanism name is authorized to act as a username.
  60. *
  61. * @param [in] name Mechanism name
  62. * @param [in] username System username
  63. *
  64. * This is a simple wrapper around gss_authorize_localname(). It only supports
  65. * system usernames as local names, and cannot distinguish between lack of
  66. * authorization and other errors.
  67. *
  68. * @retval 1 @a name is authorized to act as @a username
  69. * @retval 0 @a name is not authorized or an error occurred
  70. */
  71. int KRB5_CALLCONV
  72. gss_userok(const gss_name_t name,
  73. const char *username);
  74. /**
  75. * Determine whether a mechanism name is authorized to act as a local name.
  76. *
  77. * @param [out] minor Minor status code
  78. * @param [in] name Mechanism name
  79. * @param [in] user Local name
  80. *
  81. * @a name is a mechanism name, typically the result of a completed
  82. * gss_accept_sec_context(). @a user is an internal name representing a local
  83. * name, such as a name imported by gss_import_name() with an @a
  84. * input_name_type of @c GSS_C_NT_USER_NAME.
  85. *
  86. * @return Return GSS_S_COMPLETE if @a name is authorized to act as @a user,
  87. * GSS_S_UNAUTHORIZED if not, or an appropriate GSS error code if an error
  88. * occurred.
  89. *
  90. * @sa gss_userok
  91. */
  92. OM_uint32 KRB5_CALLCONV
  93. gss_authorize_localname(OM_uint32 *minor,
  94. const gss_name_t name,
  95. const gss_name_t user);
  96. OM_uint32 KRB5_CALLCONV
  97. gss_acquire_cred_with_password(
  98. OM_uint32 *, /* minor_status */
  99. const gss_name_t, /* desired_name */
  100. const gss_buffer_t, /* password */
  101. OM_uint32, /* time_req */
  102. const gss_OID_set, /* desired_mechs */
  103. gss_cred_usage_t, /* cred_usage */
  104. gss_cred_id_t *, /* output_cred_handle */
  105. gss_OID_set *, /* actual_mechs */
  106. OM_uint32 *); /* time_rec */
  107. OM_uint32 KRB5_CALLCONV
  108. gss_add_cred_with_password(
  109. OM_uint32 *, /* minor_status */
  110. const gss_cred_id_t,/* input_cred_handle */
  111. const gss_name_t, /* desired_name */
  112. const gss_OID, /* desired_mech */
  113. const gss_buffer_t, /* password */
  114. gss_cred_usage_t, /* cred_usage */
  115. OM_uint32, /* initiator_time_req */
  116. OM_uint32, /* acceptor_time_req */
  117. gss_cred_id_t *, /* output_cred_handle */
  118. gss_OID_set *, /* actual_mechs */
  119. OM_uint32 *, /* initiator_time_rec */
  120. OM_uint32 *); /* acceptor_time_rec */
  121. /*
  122. * GGF extensions
  123. */
  124. typedef struct gss_buffer_set_desc_struct {
  125. size_t count;
  126. gss_buffer_desc *elements;
  127. } gss_buffer_set_desc, *gss_buffer_set_t;
  128. #define GSS_C_NO_BUFFER_SET ((gss_buffer_set_t) 0)
  129. OM_uint32 KRB5_CALLCONV gss_create_empty_buffer_set
  130. (OM_uint32 * /*minor_status*/,
  131. gss_buffer_set_t * /*buffer_set*/);
  132. OM_uint32 KRB5_CALLCONV gss_add_buffer_set_member
  133. (OM_uint32 * /*minor_status*/,
  134. const gss_buffer_t /*member_buffer*/,
  135. gss_buffer_set_t * /*buffer_set*/);
  136. OM_uint32 KRB5_CALLCONV gss_release_buffer_set
  137. (OM_uint32 * /*minor_status*/,
  138. gss_buffer_set_t * /*buffer_set*/);
  139. OM_uint32 KRB5_CALLCONV gss_inquire_sec_context_by_oid
  140. (OM_uint32 * /*minor_status*/,
  141. const gss_ctx_id_t /*context_handle*/,
  142. const gss_OID /*desired_object*/,
  143. gss_buffer_set_t * /*data_set*/);
  144. OM_uint32 KRB5_CALLCONV gss_inquire_cred_by_oid
  145. (OM_uint32 * /*minor_status*/,
  146. const gss_cred_id_t /*cred_handle*/,
  147. const gss_OID /*desired_object*/,
  148. gss_buffer_set_t * /*data_set*/);
  149. OM_uint32 KRB5_CALLCONV gss_set_sec_context_option
  150. (OM_uint32 * /*minor_status*/,
  151. gss_ctx_id_t * /*cred_handle*/,
  152. const gss_OID /*desired_object*/,
  153. const gss_buffer_t /*value*/);
  154. /*
  155. * Export import cred extensions from GGF, but using Heimdal's signatures
  156. */
  157. OM_uint32 KRB5_CALLCONV gss_export_cred
  158. (OM_uint32 * /* minor_status */,
  159. gss_cred_id_t /* cred_handle */,
  160. gss_buffer_t /* token */);
  161. OM_uint32 KRB5_CALLCONV gss_import_cred
  162. (OM_uint32 * /* minor_status */,
  163. gss_buffer_t /* token */,
  164. gss_cred_id_t * /* cred_handle */);
  165. /*
  166. * Heimdal extension
  167. */
  168. OM_uint32 KRB5_CALLCONV gss_set_cred_option
  169. (OM_uint32 * /*minor_status*/,
  170. gss_cred_id_t * /*cred*/,
  171. const gss_OID /*desired_object*/,
  172. const gss_buffer_t /*value*/);
  173. /*
  174. * Call the given method on the given mechanism
  175. */
  176. OM_uint32 KRB5_CALLCONV gssspi_mech_invoke
  177. (OM_uint32 * /*minor_status*/,
  178. const gss_OID /*desired_mech*/,
  179. const gss_OID /*desired_object*/,
  180. gss_buffer_t /*value*/);
  181. /*
  182. * AEAD extensions
  183. */
  184. OM_uint32 KRB5_CALLCONV gss_wrap_aead
  185. (OM_uint32 * /*minor_status*/,
  186. gss_ctx_id_t /*context_handle*/,
  187. int /*conf_req_flag*/,
  188. gss_qop_t /*qop_req*/,
  189. gss_buffer_t /*input_assoc_buffer*/,
  190. gss_buffer_t /*input_payload_buffer*/,
  191. int * /*conf_state*/,
  192. gss_buffer_t /*output_message_buffer*/);
  193. OM_uint32 KRB5_CALLCONV gss_unwrap_aead
  194. (OM_uint32 * /*minor_status*/,
  195. gss_ctx_id_t /*context_handle*/,
  196. gss_buffer_t /*input_message_buffer*/,
  197. gss_buffer_t /*input_assoc_buffer*/,
  198. gss_buffer_t /*output_payload_buffer*/,
  199. int * /*conf_state*/,
  200. gss_qop_t * /*qop_state*/);
  201. /*
  202. * SSPI extensions
  203. */
  204. #define GSS_C_DCE_STYLE 0x1000
  205. #define GSS_C_IDENTIFY_FLAG 0x2000
  206. #define GSS_C_EXTENDED_ERROR_FLAG 0x4000
  207. /*
  208. * Returns a buffer set with the first member containing the
  209. * session key for SSPI compatibility. The optional second
  210. * member contains an OID identifying the session key type.
  211. */
  212. GSS_DLLIMP extern gss_OID GSS_C_INQ_SSPI_SESSION_KEY;
  213. GSS_DLLIMP extern gss_OID GSS_C_INQ_NEGOEX_KEY;
  214. GSS_DLLIMP extern gss_OID GSS_C_INQ_NEGOEX_VERIFY_KEY;
  215. OM_uint32 KRB5_CALLCONV gss_complete_auth_token
  216. (OM_uint32 *minor_status,
  217. const gss_ctx_id_t context_handle,
  218. gss_buffer_t input_message_buffer);
  219. typedef struct gss_iov_buffer_desc_struct {
  220. OM_uint32 type;
  221. gss_buffer_desc buffer;
  222. } gss_iov_buffer_desc, *gss_iov_buffer_t;
  223. #define GSS_C_NO_IOV_BUFFER ((gss_iov_buffer_t)0)
  224. #define GSS_IOV_BUFFER_TYPE_EMPTY 0
  225. #define GSS_IOV_BUFFER_TYPE_DATA 1 /* Packet data */
  226. #define GSS_IOV_BUFFER_TYPE_HEADER 2 /* Mechanism header */
  227. #define GSS_IOV_BUFFER_TYPE_MECH_PARAMS 3 /* Mechanism specific parameters */
  228. #define GSS_IOV_BUFFER_TYPE_TRAILER 7 /* Mechanism trailer */
  229. #define GSS_IOV_BUFFER_TYPE_PADDING 9 /* Padding */
  230. #define GSS_IOV_BUFFER_TYPE_STREAM 10 /* Complete wrap token */
  231. #define GSS_IOV_BUFFER_TYPE_SIGN_ONLY 11 /* Sign only packet data */
  232. #define GSS_IOV_BUFFER_TYPE_MIC_TOKEN 12 /* MIC token destination */
  233. #define GSS_IOV_BUFFER_FLAG_MASK 0xFFFF0000
  234. #define GSS_IOV_BUFFER_FLAG_ALLOCATE 0x00010000 /* indicates GSS should allocate */
  235. #define GSS_IOV_BUFFER_FLAG_ALLOCATED 0x00020000 /* indicates caller should free */
  236. #define GSS_IOV_BUFFER_TYPE(_type) ((_type) & ~(GSS_IOV_BUFFER_FLAG_MASK))
  237. #define GSS_IOV_BUFFER_FLAGS(_type) ((_type) & GSS_IOV_BUFFER_FLAG_MASK)
  238. /*
  239. * Sign and optionally encrypt a sequence of buffers. The buffers
  240. * shall be ordered HEADER | DATA | PADDING | TRAILER. Suitable
  241. * space for the header, padding and trailer should be provided
  242. * by calling gss_wrap_iov_length(), or the ALLOCATE flag should
  243. * be set on those buffers.
  244. *
  245. * Encryption is in-place. SIGN_ONLY buffers are untouched. Only
  246. * a single PADDING buffer should be provided. The order of the
  247. * buffers in memory does not matter. Buffers in the IOV should
  248. * be arranged in the order above, and in the case of multiple
  249. * DATA buffers the sender and receiver should agree on the
  250. * order.
  251. *
  252. * With GSS_C_DCE_STYLE it is acceptable to not provide PADDING
  253. * and TRAILER, but the caller must guarantee the plaintext data
  254. * being encrypted is correctly padded, otherwise an error will
  255. * be returned.
  256. *
  257. * While applications that have knowledge of the underlying
  258. * cryptosystem may request a specific configuration of data
  259. * buffers, the only generally supported configurations are:
  260. *
  261. * HEADER | DATA | PADDING | TRAILER
  262. *
  263. * which will emit GSS_Wrap() compatible tokens, and:
  264. *
  265. * HEADER | SIGN_ONLY | DATA | PADDING | TRAILER
  266. *
  267. * for AEAD.
  268. *
  269. * The typical (special cased) usage for DCE is as follows:
  270. *
  271. * SIGN_ONLY_1 | DATA | SIGN_ONLY_2 | HEADER
  272. */
  273. OM_uint32 KRB5_CALLCONV gss_wrap_iov
  274. (
  275. OM_uint32 *, /* minor_status */
  276. gss_ctx_id_t, /* context_handle */
  277. int, /* conf_req_flag */
  278. gss_qop_t, /* qop_req */
  279. int *, /* conf_state */
  280. gss_iov_buffer_desc *, /* iov */
  281. int); /* iov_count */
  282. /*
  283. * Verify and optionally decrypt a sequence of buffers. To process
  284. * a GSS-API message without separate buffer, pass STREAM | DATA.
  285. * Upon return DATA will contain the decrypted or integrity
  286. * protected message. Only a single DATA buffer may be provided
  287. * with this usage. DATA by default will point into STREAM, but if
  288. * the ALLOCATE flag is set a copy will be returned.
  289. *
  290. * Otherwise, decryption is in-place. SIGN_ONLY buffers are
  291. * untouched.
  292. */
  293. OM_uint32 KRB5_CALLCONV gss_unwrap_iov
  294. (
  295. OM_uint32 *, /* minor_status */
  296. gss_ctx_id_t, /* context_handle */
  297. int *, /* conf_state */
  298. gss_qop_t *, /* qop_state */
  299. gss_iov_buffer_desc *, /* iov */
  300. int); /* iov_count */
  301. /*
  302. * Query HEADER, PADDING and TRAILER buffer lengths. DATA buffers
  303. * should be provided so the correct padding length can be determined.
  304. */
  305. OM_uint32 KRB5_CALLCONV gss_wrap_iov_length
  306. (
  307. OM_uint32 *, /* minor_status */
  308. gss_ctx_id_t, /* context_handle */
  309. int, /* conf_req_flag */
  310. gss_qop_t, /* qop_req */
  311. int *, /* conf_state */
  312. gss_iov_buffer_desc *, /* iov */
  313. int); /* iov_count */
  314. /*
  315. * Produce a GSSAPI MIC token for a sequence of buffers. All SIGN_ONLY and
  316. * DATA buffers will be signed, in the order they appear. One MIC_TOKEN buffer
  317. * must be included for the result. Suitable space should be provided for the
  318. * MIC_TOKEN buffer by calling gss_get_mic_iov_length, or the ALLOCATE flag
  319. * should be set on that buffer. If the ALLOCATE flag is used, use
  320. * gss_release_iov_buffer to free the allocated buffer within the iov list when
  321. * it is no longer needed.
  322. */
  323. OM_uint32 KRB5_CALLCONV gss_get_mic_iov
  324. (
  325. OM_uint32 *, /* minor_status */
  326. gss_ctx_id_t, /* context_handle */
  327. gss_qop_t, /* qop_req */
  328. gss_iov_buffer_desc *, /* iov */
  329. int); /* iov_count */
  330. /*
  331. * Query the MIC_TOKEN buffer length within the iov list.
  332. */
  333. OM_uint32 KRB5_CALLCONV gss_get_mic_iov_length(
  334. OM_uint32 *, /* minor_status */
  335. gss_ctx_id_t, /* context_handle */
  336. gss_qop_t, /* qop_req */
  337. gss_iov_buffer_desc *, /* iov */
  338. int); /* iov_count */
  339. /*
  340. * Verify the MIC_TOKEN buffer within the iov list against the SIGN_ONLY and
  341. * DATA buffers in the order they appear. Return values are the same as for
  342. * gss_verify_mic.
  343. */
  344. OM_uint32 KRB5_CALLCONV gss_verify_mic_iov
  345. (
  346. OM_uint32 *, /* minor_status */
  347. gss_ctx_id_t, /* context_handle */
  348. gss_qop_t *, /* qop_state */
  349. gss_iov_buffer_desc *, /* iov */
  350. int); /* iov_count */
  351. /*
  352. * Release buffers that have the ALLOCATED flag set.
  353. */
  354. OM_uint32 KRB5_CALLCONV gss_release_iov_buffer
  355. (
  356. OM_uint32 *, /* minor_status */
  357. gss_iov_buffer_desc *, /* iov */
  358. int); /* iov_count */
  359. /*
  360. * Protocol transition
  361. */
  362. OM_uint32 KRB5_CALLCONV
  363. gss_acquire_cred_impersonate_name(
  364. OM_uint32 *, /* minor_status */
  365. const gss_cred_id_t, /* impersonator_cred_handle */
  366. const gss_name_t, /* desired_name */
  367. OM_uint32, /* time_req */
  368. const gss_OID_set, /* desired_mechs */
  369. gss_cred_usage_t, /* cred_usage */
  370. gss_cred_id_t *, /* output_cred_handle */
  371. gss_OID_set *, /* actual_mechs */
  372. OM_uint32 *); /* time_rec */
  373. OM_uint32 KRB5_CALLCONV
  374. gss_add_cred_impersonate_name(
  375. OM_uint32 *, /* minor_status */
  376. gss_cred_id_t, /* input_cred_handle */
  377. const gss_cred_id_t, /* impersonator_cred_handle */
  378. const gss_name_t, /* desired_name */
  379. const gss_OID, /* desired_mech */
  380. gss_cred_usage_t, /* cred_usage */
  381. OM_uint32, /* initiator_time_req */
  382. OM_uint32, /* acceptor_time_req */
  383. gss_cred_id_t *, /* output_cred_handle */
  384. gss_OID_set *, /* actual_mechs */
  385. OM_uint32 *, /* initiator_time_rec */
  386. OM_uint32 *); /* acceptor_time_rec */
  387. /*
  388. * Naming extensions
  389. */
  390. GSS_DLLIMP extern gss_buffer_t GSS_C_ATTR_LOCAL_LOGIN_USER;
  391. GSS_DLLIMP extern gss_OID GSS_C_NT_COMPOSITE_EXPORT;
  392. OM_uint32 KRB5_CALLCONV gss_display_name_ext
  393. (
  394. OM_uint32 *, /* minor_status */
  395. gss_name_t, /* name */
  396. gss_OID, /* display_as_name_type */
  397. gss_buffer_t /* display_name */
  398. );
  399. OM_uint32 KRB5_CALLCONV gss_inquire_name
  400. (
  401. OM_uint32 *, /* minor_status */
  402. gss_name_t, /* name */
  403. int *, /* name_is_MN */
  404. gss_OID *, /* MN_mech */
  405. gss_buffer_set_t * /* attrs */
  406. );
  407. OM_uint32 KRB5_CALLCONV gss_get_name_attribute
  408. (
  409. OM_uint32 *, /* minor_status */
  410. gss_name_t, /* name */
  411. gss_buffer_t, /* attr */
  412. int *, /* authenticated */
  413. int *, /* complete */
  414. gss_buffer_t, /* value */
  415. gss_buffer_t, /* display_value */
  416. int * /* more */
  417. );
  418. OM_uint32 KRB5_CALLCONV gss_set_name_attribute
  419. (
  420. OM_uint32 *, /* minor_status */
  421. gss_name_t, /* name */
  422. int, /* complete */
  423. gss_buffer_t, /* attr */
  424. gss_buffer_t /* value */
  425. );
  426. OM_uint32 KRB5_CALLCONV gss_delete_name_attribute
  427. (
  428. OM_uint32 *, /* minor_status */
  429. gss_name_t, /* name */
  430. gss_buffer_t /* attr */
  431. );
  432. OM_uint32 KRB5_CALLCONV gss_export_name_composite
  433. (
  434. OM_uint32 *, /* minor_status */
  435. gss_name_t, /* name */
  436. gss_buffer_t /* exp_composite_name */
  437. );
  438. typedef struct gss_any *gss_any_t;
  439. OM_uint32 KRB5_CALLCONV gss_map_name_to_any
  440. (
  441. OM_uint32 *, /* minor_status */
  442. gss_name_t, /* name */
  443. int, /* authenticated */
  444. gss_buffer_t, /* type_id */
  445. gss_any_t * /* output */
  446. );
  447. OM_uint32 KRB5_CALLCONV gss_release_any_name_mapping
  448. (
  449. OM_uint32 *, /* minor_status */
  450. gss_name_t, /* name */
  451. gss_buffer_t, /* type_id */
  452. gss_any_t * /* input */
  453. );
  454. /* draft-josefsson-gss-capsulate */
  455. OM_uint32 KRB5_CALLCONV gss_encapsulate_token
  456. (
  457. gss_const_buffer_t, /* input_token */
  458. gss_const_OID, /* token_oid */
  459. gss_buffer_t /* output_token */
  460. );
  461. OM_uint32 KRB5_CALLCONV gss_decapsulate_token
  462. (
  463. gss_const_buffer_t, /* input_token */
  464. gss_const_OID, /* token_oid */
  465. gss_buffer_t /* output_token */
  466. );
  467. int KRB5_CALLCONV gss_oid_equal
  468. (
  469. gss_const_OID, /* first_oid */
  470. gss_const_OID /* second_oid */
  471. );
  472. /* Credential store extensions */
  473. struct gss_key_value_element_struct {
  474. const char *key;
  475. const char *value;
  476. };
  477. typedef struct gss_key_value_element_struct gss_key_value_element_desc;
  478. struct gss_key_value_set_struct {
  479. OM_uint32 count;
  480. gss_key_value_element_desc *elements;
  481. };
  482. typedef struct gss_key_value_set_struct gss_key_value_set_desc;
  483. typedef const gss_key_value_set_desc *gss_const_key_value_set_t;
  484. #define GSS_C_NO_CRED_STORE ((gss_const_key_value_set_t) 0)
  485. OM_uint32 KRB5_CALLCONV
  486. gss_acquire_cred_from(
  487. OM_uint32 *, /* minor_status */
  488. gss_name_t, /* desired_name */
  489. OM_uint32, /* time_req */
  490. gss_OID_set, /* desired_mechs */
  491. gss_cred_usage_t, /* cred_usage */
  492. gss_const_key_value_set_t, /* cred_store */
  493. gss_cred_id_t *, /* output_cred_handle */
  494. gss_OID_set *, /* actual_mechs */
  495. OM_uint32 *); /* time_rec */
  496. OM_uint32 KRB5_CALLCONV
  497. gss_add_cred_from(
  498. OM_uint32 *, /* minor_status */
  499. gss_cred_id_t, /* input_cred_handle */
  500. gss_name_t, /* desired_name */
  501. gss_OID, /* desired_mech */
  502. gss_cred_usage_t, /* cred_usage */
  503. OM_uint32, /* initiator_time_req */
  504. OM_uint32, /* acceptor_time_req */
  505. gss_const_key_value_set_t, /* cred_store */
  506. gss_cred_id_t *, /* output_cred_handle */
  507. gss_OID_set *, /* actual_mechs */
  508. OM_uint32 *, /* initiator_time_rec */
  509. OM_uint32 *); /* acceptor_time_rec */
  510. OM_uint32 KRB5_CALLCONV
  511. gss_store_cred_into(
  512. OM_uint32 *, /* minor_status */
  513. gss_cred_id_t, /* input_cred_handle */
  514. gss_cred_usage_t, /* input_usage */
  515. gss_OID, /* desired_mech */
  516. OM_uint32, /* overwrite_cred */
  517. OM_uint32, /* default_cred */
  518. gss_const_key_value_set_t, /* cred_store */
  519. gss_OID_set *, /* elements_stored */
  520. gss_cred_usage_t *); /* cred_usage_stored */
  521. /*
  522. * A mech can make itself negotiable via NegoEx (draft-zhu-negoex) by
  523. * implementing the following three SPIs, and also implementing
  524. * gss_inquire_sec_context_by_oid() and answering the GSS_C_INQ_NEGOEX_KEY and
  525. * GSS_C_INQ_NEGOEX_VERIFY_KEY OIDs. The answer must be in two buffers: the
  526. * first contains the key contents, and the second contains the key enctype as
  527. * a four-byte little-endian integer.
  528. *
  529. * By default, NegoEx mechanisms will not be directly negotiated via SPNEGO.
  530. * If direct SPNEGO negotiation is required for interoperability, implement
  531. * gss_inquire_attrs_for_mech() and assert the GSS_C_MA_NEGOEX_AND_SPNEGO
  532. * attribute (along with any applicable RFC 5587 attributes).
  533. */
  534. #define GSS_C_CHANNEL_BOUND_FLAG 2048 /* 0x00000800 */
  535. OM_uint32 KRB5_CALLCONV
  536. gssspi_query_meta_data(
  537. OM_uint32 *minor_status,
  538. gss_const_OID mech_oid,
  539. gss_cred_id_t cred_handle,
  540. gss_ctx_id_t *context_handle,
  541. const gss_name_t targ_name,
  542. OM_uint32 req_flags,
  543. gss_buffer_t meta_data);
  544. OM_uint32 KRB5_CALLCONV
  545. gssspi_exchange_meta_data(
  546. OM_uint32 *minor_status,
  547. gss_const_OID mech_oid,
  548. gss_cred_id_t cred_handle,
  549. gss_ctx_id_t *context_handle,
  550. const gss_name_t targ_name,
  551. OM_uint32 req_flags,
  552. gss_const_buffer_t meta_data);
  553. OM_uint32 KRB5_CALLCONV
  554. gssspi_query_mechanism_info(
  555. OM_uint32 *minor_status,
  556. gss_const_OID mech_oid,
  557. unsigned char auth_scheme[16]);
  558. GSS_DLLIMP extern gss_const_OID GSS_C_MA_NEGOEX_AND_SPNEGO;
  559. #ifdef __cplusplus
  560. }
  561. #endif
  562. /*
  563. * When used with gss_inquire_sec_context_by_oid(), return a buffer set with
  564. * the first member containing an unsigned 32-bit integer in network byte
  565. * order. This is the Security Strength Factor (SSF) associated with the
  566. * secure channel established by the security context. NOTE: This value is
  567. * made available solely as an indication for use by APIs like Cyrus SASL that
  568. * classify the strength of a secure channel via this number. The strength of
  569. * a channel cannot necessarily be represented by a simple number.
  570. */
  571. GSS_DLLIMP extern gss_OID GSS_C_SEC_CONTEXT_SASL_SSF;
  572. #endif /* GSSAPI_EXT_H_ */