1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Modifications for Lustre
6 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
8 * Author: Eric Mei <ericm@clusterfs.com>
12 * Somewhat simplified version of the gss api.
14 * Dug Song <dugsong@monkey.org>
15 * Andy Adamson <andros@umich.edu>
16 * Bruce Fields <bfields@umich.edu>
17 * Copyright (c) 2000 The Regents of the University of Michigan
21 #ifndef __PTLRPC_GSS_GSS_API_H_
22 #define __PTLRPC_GSS_GSS_API_H_
26 /* The mechanism-independent gss-api context: */
28 struct gss_api_mech *mech_type;
29 void *internal_ctx_id;
32 #define GSS_C_NO_BUFFER ((rawobj_t) 0)
33 #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0)
34 #define GSS_C_NULL_OID ((rawobj_t) 0)
37 * gss-api prototypes; note that these are somewhat simplified versions of
38 * the prototypes specified in RFC 2744.
40 __u32 lgss_import_sec_context(
41 rawobj_t *input_token,
42 struct gss_api_mech *mech,
43 struct gss_ctx **ctx);
44 __u32 lgss_copy_reverse_context(
46 struct gss_ctx **ctx_new);
47 __u32 lgss_inquire_context(
49 unsigned long *endtime);
55 __u32 lgss_verify_mic(
71 __u32 lgss_plain_encrypt(
77 __u32 lgss_delete_sec_context(
78 struct gss_ctx **ctx);
84 struct subflavor_desc {
91 /* Each mechanism is described by the following struct: */
93 struct list_head gm_list;
94 struct module *gm_owner;
98 struct gss_api_ops *gm_ops;
100 struct subflavor_desc *gm_sfs;
103 /* and must provide the following operations: */
105 __u32 (*gss_import_sec_context)(
106 rawobj_t *input_token,
107 struct gss_ctx *ctx);
108 __u32 (*gss_copy_reverse_context)(
110 struct gss_ctx *ctx_new);
111 __u32 (*gss_inquire_context)(
113 unsigned long *endtime);
114 __u32 (*gss_get_mic)(
118 rawobj_t *mic_token);
119 __u32 (*gss_verify_mic)(
123 rawobj_t *mic_token);
129 rawobj_t *out_token);
135 __u32 (*gss_plain_encrypt)(
141 void (*gss_delete_sec_context)(
149 int lgss_mech_register(struct gss_api_mech *mech);
150 void lgss_mech_unregister(struct gss_api_mech *mech);
152 struct gss_api_mech * lgss_OID_to_mech(rawobj_t *oid);
153 struct gss_api_mech * lgss_name_to_mech(char *name);
154 struct gss_api_mech * lgss_subflavor_to_mech(__u32 subflavor);
156 struct gss_api_mech * lgss_mech_get(struct gss_api_mech *mech);
157 void lgss_mech_put(struct gss_api_mech *mech);
159 #endif /* __PTLRPC_GSS_GSS_API_H_ */