aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@fieldses.org>2005-10-13 16:54:37 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-10-19 02:19:42 -0400
commit293f1eb551a77fe5c8956a559a3c0baea95cd9bc (patch)
tree03c770935eb42f6deccb275be0326d2f4b17c80c
parent1d95db8e1688ed54e143a597c5570631a42fa594 (diff)
SUNRPC: Add support for privacy to generic gss-api code.
Add support for privacy to generic gss-api code. This is dead code until we have both a mechanism that supports privacy and code in the client or server that uses it. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--include/linux/sunrpc/gss_api.h22
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c22
2 files changed, 44 insertions, 0 deletions
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 689262f6305..e896752ffbf 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -48,6 +48,17 @@ u32 gss_verify_mic(
48 struct xdr_buf *message, 48 struct xdr_buf *message,
49 struct xdr_netobj *mic_token, 49 struct xdr_netobj *mic_token,
50 u32 *qstate); 50 u32 *qstate);
51u32 gss_wrap(
52 struct gss_ctx *ctx_id,
53 u32 qop,
54 int offset,
55 struct xdr_buf *outbuf,
56 struct page **inpages);
57u32 gss_unwrap(
58 struct gss_ctx *ctx_id,
59 u32 *qop,
60 int offset,
61 struct xdr_buf *inbuf);
51u32 gss_delete_sec_context( 62u32 gss_delete_sec_context(
52 struct gss_ctx **ctx_id); 63 struct gss_ctx **ctx_id);
53 64
@@ -93,6 +104,17 @@ struct gss_api_ops {
93 struct xdr_buf *message, 104 struct xdr_buf *message,
94 struct xdr_netobj *mic_token, 105 struct xdr_netobj *mic_token,
95 u32 *qstate); 106 u32 *qstate);
107 u32 (*gss_wrap)(
108 struct gss_ctx *ctx_id,
109 u32 qop,
110 int offset,
111 struct xdr_buf *outbuf,
112 struct page **inpages);
113 u32 (*gss_unwrap)(
114 struct gss_ctx *ctx_id,
115 u32 *qop,
116 int offset,
117 struct xdr_buf *buf);
96 void (*gss_delete_sec_context)( 118 void (*gss_delete_sec_context)(
97 void *internal_ctx_id); 119 void *internal_ctx_id);
98}; 120};
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index 58aeaddd8c7..06d97cb3481 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -276,6 +276,28 @@ gss_verify_mic(struct gss_ctx *context_handle,
276 qstate); 276 qstate);
277} 277}
278 278
279u32
280gss_wrap(struct gss_ctx *ctx_id,
281 u32 qop,
282 int offset,
283 struct xdr_buf *buf,
284 struct page **inpages)
285{
286 return ctx_id->mech_type->gm_ops
287 ->gss_wrap(ctx_id, qop, offset, buf, inpages);
288}
289
290u32
291gss_unwrap(struct gss_ctx *ctx_id,
292 u32 *qop,
293 int offset,
294 struct xdr_buf *buf)
295{
296 return ctx_id->mech_type->gm_ops
297 ->gss_unwrap(ctx_id, qop, offset, buf);
298}
299
300
279/* gss_delete_sec_context: free all resources associated with context_handle. 301/* gss_delete_sec_context: free all resources associated with context_handle.
280 * Note this differs from the RFC 2744-specified prototype in that we don't 302 * Note this differs from the RFC 2744-specified prototype in that we don't
281 * bother returning an output token, since it would never be used anyway. */ 303 * bother returning an output token, since it would never be used anyway. */