2 * Modifications for Lustre
4 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
6 * Author: Eric Mei <ericm@clusterfs.com>
10 * Somewhat simplified version of the gss api.
12 * Dug Song <dugsong@monkey.org>
13 * Andy Adamson <andros@umich.edu>
14 * Bruce Fields <bfields@umich.edu>
15 * Copyright (c) 2000 The Regents of the University of Michigan
19 #ifndef __PTLRPC_GSS_GSS_API_H_
20 #define __PTLRPC_GSS_GSS_API_H_
24 typedef int (*digest_hash)(
25 struct ahash_request *req, rawobj_t *hdr,
26 int msgcnt, rawobj_t *msgs,
27 int iovcnt, lnet_kiov_t *iovs);
29 /* The mechanism-independent gss-api context: */
31 struct gss_api_mech *mech_type;
32 void *internal_ctx_id;
33 digest_hash hash_func;
36 #define GSS_C_NO_BUFFER ((rawobj_t) 0)
37 #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0)
38 #define GSS_C_NULL_OID ((rawobj_t) 0)
41 * gss-api prototypes; note that these are somewhat simplified versions of
42 * the prototypes specified in RFC 2744.
44 __u32 lgss_import_sec_context(
45 rawobj_t *input_token,
46 struct gss_api_mech *mech,
47 struct gss_ctx **ctx);
48 __u32 lgss_copy_reverse_context(
50 struct gss_ctx **ctx_new);
51 __u32 lgss_inquire_context(
61 __u32 lgss_verify_mic(
81 struct ptlrpc_bulk_desc *desc);
84 struct ptlrpc_bulk_desc *desc,
87 __u32 lgss_unwrap_bulk(
89 struct ptlrpc_bulk_desc *desc,
92 __u32 lgss_delete_sec_context(
93 struct gss_ctx **ctx);
99 struct subflavor_desc {
106 /* Each mechanism is described by the following struct: */
107 struct gss_api_mech {
108 struct list_head gm_list;
109 struct module *gm_owner;
113 struct gss_api_ops *gm_ops;
115 struct subflavor_desc *gm_sfs;
118 /* and must provide the following operations: */
120 __u32 (*gss_import_sec_context)(
121 rawobj_t *input_token,
122 struct gss_ctx *ctx);
123 __u32 (*gss_copy_reverse_context)(
125 struct gss_ctx *ctx_new);
126 __u32 (*gss_inquire_context)(
129 __u32 (*gss_get_mic)(
135 rawobj_t *mic_token);
136 __u32 (*gss_verify_mic)(
142 rawobj_t *mic_token);
148 rawobj_t *out_token);
154 __u32 (*gss_prep_bulk)(
155 struct gss_ctx *gctx,
156 struct ptlrpc_bulk_desc *desc);
157 __u32 (*gss_wrap_bulk)(
158 struct gss_ctx *gctx,
159 struct ptlrpc_bulk_desc *desc,
162 __u32 (*gss_unwrap_bulk)(
163 struct gss_ctx *gctx,
164 struct ptlrpc_bulk_desc *desc,
167 void (*gss_delete_sec_context)(
175 int lgss_mech_register(struct gss_api_mech *mech);
176 void lgss_mech_unregister(struct gss_api_mech *mech);
178 struct gss_api_mech * lgss_OID_to_mech(rawobj_t *oid);
179 struct gss_api_mech * lgss_name_to_mech(char *name);
180 struct gss_api_mech * lgss_subflavor_to_mech(__u32 subflavor);
182 struct gss_api_mech * lgss_mech_get(struct gss_api_mech *mech);
183 void lgss_mech_put(struct gss_api_mech *mech);
185 #endif /* __PTLRPC_GSS_GSS_API_H_ */