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(
68 __u32 lgss_plain_encrypt(
74 __u32 lgss_delete_sec_context(
75 struct gss_ctx **ctx);
81 struct subflavor_desc {
88 /* Each mechanism is described by the following struct: */
90 struct list_head gm_list;
91 struct module *gm_owner;
95 struct gss_api_ops *gm_ops;
97 struct subflavor_desc *gm_sfs;
100 /* and must provide the following operations: */
102 __u32 (*gss_import_sec_context)(
103 rawobj_t *input_token,
104 struct gss_ctx *ctx);
105 __u32 (*gss_copy_reverse_context)(
107 struct gss_ctx *ctx_new);
108 __u32 (*gss_inquire_context)(
110 unsigned long *endtime);
111 __u32 (*gss_get_mic)(
115 rawobj_t *mic_token);
116 __u32 (*gss_verify_mic)(
120 rawobj_t *mic_token);
125 rawobj_t *out_token);
130 __u32 (*gss_plain_encrypt)(
136 void (*gss_delete_sec_context)(
144 int lgss_mech_register(struct gss_api_mech *mech);
145 void lgss_mech_unregister(struct gss_api_mech *mech);
147 struct gss_api_mech * lgss_OID_to_mech(rawobj_t *oid);
148 struct gss_api_mech * lgss_name_to_mech(char *name);
149 struct gss_api_mech * lgss_subflavor_to_mech(__u32 subflavor);
151 struct gss_api_mech * lgss_mech_get(struct gss_api_mech *mech);
152 void lgss_mech_put(struct gss_api_mech *mech);
154 #endif /* __PTLRPC_GSS_GSS_API_H_ */