diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-04-29 14:03:30 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-04-29 16:23:34 -0400 |
commit | b1df7637232927ac69ed1a32e9c6b768f635b7d4 (patch) | |
tree | cf5fdd96cccb3a89f4e0dea895775eb7c428c533 /include/linux/sunrpc | |
parent | dd30333cf5a2f9dfecda5c6f4523133f13847aae (diff) | |
parent | 721ccfb79b6f74f4052de70236d24047e73682d4 (diff) |
Merge branch 'nfs-for-next' of git://linux-nfs.org/~trondmy/nfs-2.6 into for-3.10
Note conflict: Chuck's patches modified (and made static)
gss_mech_get_by_OID, which is still needed by gss-proxy patches.
The conflict resolution is a bit minimal; we may want some more cleanup.
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/auth.h | 9 | ||||
-rw-r--r-- | include/linux/sunrpc/gss_api.h | 30 |
2 files changed, 32 insertions, 7 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 58fda1c3c783..0dd00f4f6810 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -22,6 +22,8 @@ | |||
22 | /* size of the nodename buffer */ | 22 | /* size of the nodename buffer */ |
23 | #define UNX_MAXNODENAME 32 | 23 | #define UNX_MAXNODENAME 32 |
24 | 24 | ||
25 | struct rpcsec_gss_info; | ||
26 | |||
25 | /* Work around the lack of a VFS credential */ | 27 | /* Work around the lack of a VFS credential */ |
26 | struct auth_cred { | 28 | struct auth_cred { |
27 | kuid_t uid; | 29 | kuid_t uid; |
@@ -103,6 +105,9 @@ struct rpc_authops { | |||
103 | int (*pipes_create)(struct rpc_auth *); | 105 | int (*pipes_create)(struct rpc_auth *); |
104 | void (*pipes_destroy)(struct rpc_auth *); | 106 | void (*pipes_destroy)(struct rpc_auth *); |
105 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); | 107 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); |
108 | rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); | ||
109 | int (*flavor2info)(rpc_authflavor_t, | ||
110 | struct rpcsec_gss_info *); | ||
106 | }; | 111 | }; |
107 | 112 | ||
108 | struct rpc_credops { | 113 | struct rpc_credops { |
@@ -137,6 +142,10 @@ int rpcauth_register(const struct rpc_authops *); | |||
137 | int rpcauth_unregister(const struct rpc_authops *); | 142 | int rpcauth_unregister(const struct rpc_authops *); |
138 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 143 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
139 | void rpcauth_release(struct rpc_auth *); | 144 | void rpcauth_release(struct rpc_auth *); |
145 | rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t, | ||
146 | struct rpcsec_gss_info *); | ||
147 | int rpcauth_get_gssinfo(rpc_authflavor_t, | ||
148 | struct rpcsec_gss_info *); | ||
140 | int rpcauth_list_flavors(rpc_authflavor_t *, int); | 149 | int rpcauth_list_flavors(rpc_authflavor_t *, int); |
141 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 150 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
142 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 151 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 04d03bb2de5d..161463e59624 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -25,10 +25,21 @@ struct gss_ctx { | |||
25 | 25 | ||
26 | #define GSS_C_NO_BUFFER ((struct xdr_netobj) 0) | 26 | #define GSS_C_NO_BUFFER ((struct xdr_netobj) 0) |
27 | #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0) | 27 | #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0) |
28 | #define GSS_C_NULL_OID ((struct xdr_netobj) 0) | 28 | #define GSS_C_QOP_DEFAULT (0) |
29 | 29 | ||
30 | /*XXX arbitrary length - is this set somewhere? */ | 30 | /*XXX arbitrary length - is this set somewhere? */ |
31 | #define GSS_OID_MAX_LEN 32 | 31 | #define GSS_OID_MAX_LEN 32 |
32 | struct rpcsec_gss_oid { | ||
33 | unsigned int len; | ||
34 | u8 data[GSS_OID_MAX_LEN]; | ||
35 | }; | ||
36 | |||
37 | /* From RFC 3530 */ | ||
38 | struct rpcsec_gss_info { | ||
39 | struct rpcsec_gss_oid oid; | ||
40 | u32 qop; | ||
41 | u32 service; | ||
42 | }; | ||
32 | 43 | ||
33 | /* gss-api prototypes; note that these are somewhat simplified versions of | 44 | /* gss-api prototypes; note that these are somewhat simplified versions of |
34 | * the prototypes specified in RFC 2744. */ | 45 | * the prototypes specified in RFC 2744. */ |
@@ -59,12 +70,14 @@ u32 gss_unwrap( | |||
59 | u32 gss_delete_sec_context( | 70 | u32 gss_delete_sec_context( |
60 | struct gss_ctx **ctx_id); | 71 | struct gss_ctx **ctx_id); |
61 | 72 | ||
62 | u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service); | 73 | rpc_authflavor_t gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 qop, |
74 | u32 service); | ||
63 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); | 75 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); |
64 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | 76 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); |
65 | 77 | ||
66 | struct pf_desc { | 78 | struct pf_desc { |
67 | u32 pseudoflavor; | 79 | u32 pseudoflavor; |
80 | u32 qop; | ||
68 | u32 service; | 81 | u32 service; |
69 | char *name; | 82 | char *name; |
70 | char *auth_domain_name; | 83 | char *auth_domain_name; |
@@ -77,7 +90,7 @@ struct pf_desc { | |||
77 | struct gss_api_mech { | 90 | struct gss_api_mech { |
78 | struct list_head gm_list; | 91 | struct list_head gm_list; |
79 | struct module *gm_owner; | 92 | struct module *gm_owner; |
80 | struct xdr_netobj gm_oid; | 93 | struct rpcsec_gss_oid gm_oid; |
81 | char *gm_name; | 94 | char *gm_name; |
82 | const struct gss_api_ops *gm_ops; | 95 | const struct gss_api_ops *gm_ops; |
83 | /* pseudoflavors supported by this mechanism: */ | 96 | /* pseudoflavors supported by this mechanism: */ |
@@ -121,7 +134,13 @@ void gss_mech_unregister(struct gss_api_mech *); | |||
121 | 134 | ||
122 | /* returns a mechanism descriptor given an OID, and increments the mechanism's | 135 | /* returns a mechanism descriptor given an OID, and increments the mechanism's |
123 | * reference count. */ | 136 | * reference count. */ |
124 | struct gss_api_mech * gss_mech_get_by_OID(struct xdr_netobj *); | 137 | struct gss_api_mech * gss_mech_get_by_OID(struct rpcsec_gss_oid *); |
138 | |||
139 | /* Given a GSS security tuple, look up a pseudoflavor */ | ||
140 | rpc_authflavor_t gss_mech_info2flavor(struct rpcsec_gss_info *); | ||
141 | |||
142 | /* Given a pseudoflavor, look up a GSS security tuple */ | ||
143 | int gss_mech_flavor2info(rpc_authflavor_t, struct rpcsec_gss_info *); | ||
125 | 144 | ||
126 | /* Returns a reference to a mechanism, given a name like "krb5" etc. */ | 145 | /* Returns a reference to a mechanism, given a name like "krb5" etc. */ |
127 | struct gss_api_mech *gss_mech_get_by_name(const char *); | 146 | struct gss_api_mech *gss_mech_get_by_name(const char *); |
@@ -132,9 +151,6 @@ struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | |||
132 | /* Fill in an array with a list of supported pseudoflavors */ | 151 | /* Fill in an array with a list of supported pseudoflavors */ |
133 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); | 152 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); |
134 | 153 | ||
135 | /* Just increments the mechanism's reference count and returns its input: */ | ||
136 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | ||
137 | |||
138 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a | 154 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a |
139 | * corresponding call to gss_mech_put. */ | 155 | * corresponding call to gss_mech_put. */ |
140 | void gss_mech_put(struct gss_api_mech *); | 156 | void gss_mech_put(struct gss_api_mech *); |