diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2013-03-16 15:54:34 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-03-29 15:42:56 -0400 |
| commit | fb15b26f8ba3ff629a052faf3f4a4744585ca2dc (patch) | |
| tree | 2218a2e577bf075170497549847d49840f296aae /include/linux | |
| parent | 72f4dc117b57e05120aaac6e218b8abc09a5c350 (diff) | |
SUNRPC: Define rpcsec_gss_info structure
The NFSv4 SECINFO procedure returns a list of security flavors. Any
GSS flavor also has a GSS tuple containing an OID, a quality-of-
protection value, and a service value, which specifies a particular
GSS pseudoflavor.
For simplicity and efficiency, I'd like to return each GSS tuple
from the NFSv4 SECINFO XDR decoder and pass it straight into the RPC
client.
Define a data structure that is visible to both the NFS client and
the RPC client. Take structure and field names from the relevant
standards to avoid confusion.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nfs_xdr.h | 21 | ||||
| -rw-r--r-- | include/linux/sunrpc/gss_api.h | 14 |
2 files changed, 17 insertions, 18 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index c1ca1f3f4935..b759467741eb 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -1049,25 +1049,14 @@ struct nfs4_fs_locations_res { | |||
| 1049 | struct nfs4_fs_locations *fs_locations; | 1049 | struct nfs4_fs_locations *fs_locations; |
| 1050 | }; | 1050 | }; |
| 1051 | 1051 | ||
| 1052 | struct nfs4_secinfo_oid { | 1052 | struct nfs4_secinfo4 { |
| 1053 | unsigned int len; | 1053 | u32 flavor; |
| 1054 | char data[GSS_OID_MAX_LEN]; | 1054 | struct rpcsec_gss_info flavor_info; |
| 1055 | }; | ||
| 1056 | |||
| 1057 | struct nfs4_secinfo_gss { | ||
| 1058 | struct nfs4_secinfo_oid sec_oid4; | ||
| 1059 | unsigned int qop4; | ||
| 1060 | unsigned int service; | ||
| 1061 | }; | ||
| 1062 | |||
| 1063 | struct nfs4_secinfo_flavor { | ||
| 1064 | unsigned int flavor; | ||
| 1065 | struct nfs4_secinfo_gss gss; | ||
| 1066 | }; | 1055 | }; |
| 1067 | 1056 | ||
| 1068 | struct nfs4_secinfo_flavors { | 1057 | struct nfs4_secinfo_flavors { |
| 1069 | unsigned int num_flavors; | 1058 | unsigned int num_flavors; |
| 1070 | struct nfs4_secinfo_flavor flavors[0]; | 1059 | struct nfs4_secinfo4 flavors[0]; |
| 1071 | }; | 1060 | }; |
| 1072 | 1061 | ||
| 1073 | struct nfs4_secinfo_arg { | 1062 | struct nfs4_secinfo_arg { |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index a19e2547ae6a..98950e5a8877 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
| @@ -25,10 +25,20 @@ 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) | ||
| 29 | 28 | ||
| 30 | /*XXX arbitrary length - is this set somewhere? */ | 29 | /*XXX arbitrary length - is this set somewhere? */ |
| 31 | #define GSS_OID_MAX_LEN 32 | 30 | #define GSS_OID_MAX_LEN 32 |
| 31 | struct rpcsec_gss_oid { | ||
| 32 | unsigned int len; | ||
| 33 | u8 data[GSS_OID_MAX_LEN]; | ||
| 34 | }; | ||
| 35 | |||
| 36 | /* From RFC 3530 */ | ||
| 37 | struct rpcsec_gss_info { | ||
| 38 | struct rpcsec_gss_oid oid; | ||
| 39 | u32 qop; | ||
| 40 | u32 service; | ||
| 41 | }; | ||
| 32 | 42 | ||
| 33 | /* gss-api prototypes; note that these are somewhat simplified versions of | 43 | /* gss-api prototypes; note that these are somewhat simplified versions of |
| 34 | * the prototypes specified in RFC 2744. */ | 44 | * the prototypes specified in RFC 2744. */ |
| @@ -76,7 +86,7 @@ struct pf_desc { | |||
| 76 | struct gss_api_mech { | 86 | struct gss_api_mech { |
| 77 | struct list_head gm_list; | 87 | struct list_head gm_list; |
| 78 | struct module *gm_owner; | 88 | struct module *gm_owner; |
| 79 | struct xdr_netobj gm_oid; | 89 | struct rpcsec_gss_oid gm_oid; |
| 80 | char *gm_name; | 90 | char *gm_name; |
| 81 | const struct gss_api_ops *gm_ops; | 91 | const struct gss_api_ops *gm_ops; |
| 82 | /* pseudoflavors supported by this mechanism: */ | 92 | /* pseudoflavors supported by this mechanism: */ |
