1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Modifications for Lustre
5 * Copyright 2004, Cluster File Systems, Inc.
7 * Author: Eric Mei <ericm@clusterfs.com>
11 * Somewhat simplified version of the gss api.
13 * Dug Song <dugsong@monkey.org>
14 * Andy Adamson <andros@umich.edu>
15 * Bruce Fields <bfields@umich.edu>
16 * Copyright (c) 2000 The Regents of the University of Michigan
20 #ifndef __PTLRPC_GSS_GSS_API_H_
21 #define __PTLRPC_GSS_GSS_API_H_
25 /* The mechanism-independent gss-api context: */
27 struct gss_api_mech *mech_type;
28 void *internal_ctx_id;
31 #define GSS_C_NO_BUFFER ((rawobj_t) 0)
32 #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0)
33 #define GSS_C_NULL_OID ((rawobj_t) 0)
36 * gss-api prototypes; note that these are somewhat simplified versions of
37 * the prototypes specified in RFC 2744.
39 __u32 lgss_import_sec_context(
40 rawobj_t *input_token,
41 struct gss_api_mech *mech,
42 struct gss_ctx **ctx);
43 __u32 lgss_copy_reverse_context(
45 struct gss_ctx **ctx_new);
46 __u32 lgss_inquire_context(
48 unsigned long *endtime);
54 __u32 lgss_verify_mic(
70 __u32 lgss_plain_encrypt(
76 __u32 lgss_delete_sec_context(
77 struct gss_ctx **ctx);
83 struct subflavor_desc {
90 /* Each mechanism is described by the following struct: */
92 struct list_head gm_list;
93 struct module *gm_owner;
97 struct gss_api_ops *gm_ops;
99 struct subflavor_desc *gm_sfs;
102 /* and must provide the following operations: */
104 __u32 (*gss_import_sec_context)(
105 rawobj_t *input_token,
106 struct gss_ctx *ctx);
107 __u32 (*gss_copy_reverse_context)(
109 struct gss_ctx *ctx_new);
110 __u32 (*gss_inquire_context)(
112 unsigned long *endtime);
113 __u32 (*gss_get_mic)(
117 rawobj_t *mic_token);
118 __u32 (*gss_verify_mic)(
122 rawobj_t *mic_token);
128 rawobj_t *out_token);
134 __u32 (*gss_plain_encrypt)(
140 void (*gss_delete_sec_context)(
148 int lgss_mech_register(struct gss_api_mech *mech);
149 void lgss_mech_unregister(struct gss_api_mech *mech);
151 struct gss_api_mech * lgss_OID_to_mech(rawobj_t *oid);
152 struct gss_api_mech * lgss_name_to_mech(char *name);
153 struct gss_api_mech * lgss_subflavor_to_mech(__u32 subflavor);
155 struct gss_api_mech * lgss_mech_get(struct gss_api_mech *mech);
156 void lgss_mech_put(struct gss_api_mech *mech);
158 #endif /* __PTLRPC_GSS_GSS_API_H_ */