Lines Matching refs:ctx
73 setup_token(struct krb5_ctx *ctx, struct xdr_netobj *token) in setup_token() argument
77 int body_size = GSS_KRB5_TOK_HDR_LEN + ctx->gk5e->cksumlength; in setup_token()
79 token->len = g_token_size(&ctx->mech_used, body_size); in setup_token()
82 g_make_token_header(&ctx->mech_used, body_size, (unsigned char **)&ptr); in setup_token()
91 *ptr++ = (__force u16)cpu_to_le16(ctx->gk5e->signalg); in setup_token()
99 setup_token_v2(struct krb5_ctx *ctx, struct xdr_netobj *token) in setup_token_v2() argument
105 if ((ctx->flags & KRB5_CTX_FLAG_INITIATOR) == 0) in setup_token_v2()
107 if (ctx->flags & KRB5_CTX_FLAG_ACCEPTOR_SUBKEY) in setup_token_v2()
122 token->len = GSS_KRB5_TOK_HDR_LEN + ctx->gk5e->cksumlength; in setup_token_v2()
127 gss_get_mic_v1(struct krb5_ctx *ctx, struct xdr_buf *text, in gss_get_mic_v1() argument
139 BUG_ON(ctx == NULL); in gss_get_mic_v1()
143 ptr = setup_token(ctx, token); in gss_get_mic_v1()
145 if (ctx->gk5e->keyed_cksum) in gss_get_mic_v1()
146 cksumkey = ctx->cksum; in gss_get_mic_v1()
150 if (make_checksum(ctx, ptr, 8, text, 0, cksumkey, in gss_get_mic_v1()
156 seq_send = atomic_fetch_inc(&ctx->seq_send); in gss_get_mic_v1()
158 if (krb5_make_seq_num(ctx, ctx->seq, ctx->initiate ? 0 : 0xff, in gss_get_mic_v1()
162 return (ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE; in gss_get_mic_v1()
166 gss_get_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *text, in gss_get_mic_v2() argument
180 krb5_hdr = setup_token_v2(ctx, token); in gss_get_mic_v2()
184 seq_send_be64 = cpu_to_be64(atomic64_fetch_inc(&ctx->seq_send64)); in gss_get_mic_v2()
187 if (ctx->initiate) { in gss_get_mic_v2()
188 cksumkey = ctx->initiator_sign; in gss_get_mic_v2()
191 cksumkey = ctx->acceptor_sign; in gss_get_mic_v2()
195 if (make_checksum_v2(ctx, krb5_hdr, GSS_KRB5_TOK_HDR_LEN, in gss_get_mic_v2()
203 return (ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE; in gss_get_mic_v2()
210 struct krb5_ctx *ctx = gss_ctx->internal_ctx_id; in gss_get_mic_kerberos() local
212 switch (ctx->enctype) { in gss_get_mic_kerberos()
218 return gss_get_mic_v1(ctx, text, token); in gss_get_mic_kerberos()
221 return gss_get_mic_v2(ctx, text, token); in gss_get_mic_kerberos()