61 #include <linux/types.h>
64 #include <linux/random.h>
68 # define RPCDBG_FACILITY RPCDBG_AUTH
81 ptr = (
__be16 *)token->data;
91 return (
char *)krb5_hdr;
95 setup_token_v2(
struct krb5_ctx *ctx,
struct xdr_netobj *token)
107 krb5_hdr = ptr = (
__be16 *)token->data;
122 gss_get_mic_v1(
struct krb5_ctx *ctx,
struct xdr_buf *
text,
123 struct xdr_netobj *token)
126 struct xdr_netobj md5cksum = {.len =
sizeof(cksumdata),
133 dprintk(
"RPC: %s\n", __func__);
138 ptr = setup_token(ctx, token);
140 if (ctx->
gk5e->keyed_cksum)
141 cksumkey = ctx->
cksum;
147 return GSS_S_FAILURE;
151 spin_lock(&krb5_seq_lock);
153 spin_unlock(&krb5_seq_lock);
157 return GSS_S_FAILURE;
159 return (ctx->
endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE;
163 gss_get_mic_v2(
struct krb5_ctx *ctx,
struct xdr_buf *text,
164 struct xdr_netobj *token)
167 struct xdr_netobj cksumobj = { .len =
sizeof(cksumdata),
173 unsigned int cksum_usage;
175 dprintk(
"RPC: %s\n", __func__);
177 krb5_hdr = setup_token_v2(ctx, token);
181 spin_lock(&krb5_seq_lock);
183 spin_unlock(&krb5_seq_lock);
195 text, 0, cksumkey, cksum_usage, &cksumobj))
196 return GSS_S_FAILURE;
202 return (ctx->
endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE;
207 struct xdr_netobj *token)
209 struct krb5_ctx *ctx = gss_ctx->internal_ctx_id;
217 return gss_get_mic_v1(ctx, text, token);
220 return gss_get_mic_v2(ctx, text, token);