Lines Matching refs:p
190 simple_get_bytes(const void *p, const void *end, void *res, int len) in simple_get_bytes() argument
192 const void *q = (const void *)((const char *)p + len); in simple_get_bytes()
193 if (unlikely(q > end || q < p)) in simple_get_bytes()
195 memcpy(res, p, len); in simple_get_bytes()
200 simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res) in simple_get_netobj() argument
205 p = simple_get_bytes(p, end, &len, sizeof(len)); in simple_get_netobj()
206 if (IS_ERR(p)) in simple_get_netobj()
207 return p; in simple_get_netobj()
208 q = (const void *)((const char *)p + len); in simple_get_netobj()
209 if (unlikely(q > end || q < p)) in simple_get_netobj()
211 res->data = kmemdup(p, len, GFP_NOFS); in simple_get_netobj()
219 get_key(const void *p, const void *end, in get_key() argument
225 p = simple_get_bytes(p, end, &alg, sizeof(alg)); in get_key()
226 if (IS_ERR(p)) in get_key()
241 p = ERR_PTR(-EINVAL); in get_key()
244 p = simple_get_netobj(p, end, &key); in get_key()
245 if (IS_ERR(p)) in get_key()
263 return p; in get_key()
269 p = ERR_PTR(-EINVAL); in get_key()
271 return p; in get_key()
275 gss_import_v1_context(const void *p, const void *end, struct krb5_ctx *ctx) in gss_import_v1_context() argument
279 p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); in gss_import_v1_context()
280 if (IS_ERR(p)) in gss_import_v1_context()
288 p = ERR_PTR(-EINVAL); in gss_import_v1_context()
296 if (unlikely(p + 20 > end || p + 20 < p)) { in gss_import_v1_context()
297 p = ERR_PTR(-EFAULT); in gss_import_v1_context()
300 p += 20; in gss_import_v1_context()
301 p = simple_get_bytes(p, end, &tmp, sizeof(tmp)); in gss_import_v1_context()
302 if (IS_ERR(p)) in gss_import_v1_context()
305 p = ERR_PTR(-ENOSYS); in gss_import_v1_context()
308 p = simple_get_bytes(p, end, &tmp, sizeof(tmp)); in gss_import_v1_context()
309 if (IS_ERR(p)) in gss_import_v1_context()
312 p = ERR_PTR(-ENOSYS); in gss_import_v1_context()
315 p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime)); in gss_import_v1_context()
316 if (IS_ERR(p)) in gss_import_v1_context()
318 p = simple_get_bytes(p, end, &ctx->seq_send, sizeof(ctx->seq_send)); in gss_import_v1_context()
319 if (IS_ERR(p)) in gss_import_v1_context()
321 p = simple_get_netobj(p, end, &ctx->mech_used); in gss_import_v1_context()
322 if (IS_ERR(p)) in gss_import_v1_context()
324 p = get_key(p, end, ctx, &ctx->enc); in gss_import_v1_context()
325 if (IS_ERR(p)) in gss_import_v1_context()
327 p = get_key(p, end, ctx, &ctx->seq); in gss_import_v1_context()
328 if (IS_ERR(p)) in gss_import_v1_context()
330 if (p != end) { in gss_import_v1_context()
331 p = ERR_PTR(-EFAULT); in gss_import_v1_context()
344 return PTR_ERR(p); in gss_import_v1_context()
607 gss_import_v2_context(const void *p, const void *end, struct krb5_ctx *ctx, in gss_import_v2_context() argument
612 p = simple_get_bytes(p, end, &ctx->flags, sizeof(ctx->flags)); in gss_import_v2_context()
613 if (IS_ERR(p)) in gss_import_v2_context()
617 p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime)); in gss_import_v2_context()
618 if (IS_ERR(p)) in gss_import_v2_context()
620 p = simple_get_bytes(p, end, &ctx->seq_send64, sizeof(ctx->seq_send64)); in gss_import_v2_context()
621 if (IS_ERR(p)) in gss_import_v2_context()
628 p = ERR_PTR(-EINVAL); in gss_import_v2_context()
631 p = simple_get_bytes(p, end, &ctx->enctype, sizeof(ctx->enctype)); in gss_import_v2_context()
632 if (IS_ERR(p)) in gss_import_v2_context()
641 p = ERR_PTR(-EINVAL); in gss_import_v2_context()
646 p = simple_get_bytes(p, end, ctx->Ksess, keylen); in gss_import_v2_context()
647 if (IS_ERR(p)) in gss_import_v2_context()
650 if (p != end) { in gss_import_v2_context()
651 p = ERR_PTR(-EINVAL); in gss_import_v2_context()
658 p = ERR_PTR(-ENOMEM); in gss_import_v2_context()
676 return PTR_ERR(p); in gss_import_v2_context()
680 gss_import_sec_context_kerberos(const void *p, size_t len, in gss_import_sec_context_kerberos() argument
685 const void *end = (const void *)((const char *)p + len); in gss_import_sec_context_kerberos()
694 ret = gss_import_v1_context(p, end, ctx); in gss_import_sec_context_kerberos()
696 ret = gss_import_v2_context(p, end, ctx, gfp_mask); in gss_import_sec_context_kerberos()