Lines Matching refs:ctx
33 struct tcp_fastopen_context *ctx = in tcp_fastopen_ctx_free() local
36 kfree_sensitive(ctx); in tcp_fastopen_ctx_free()
41 struct tcp_fastopen_context *ctx; in tcp_fastopen_destroy_cipher() local
43 ctx = rcu_dereference_protected( in tcp_fastopen_destroy_cipher()
44 inet_csk(sk)->icsk_accept_queue.fastopenq.ctx, 1); in tcp_fastopen_destroy_cipher()
45 if (ctx) in tcp_fastopen_destroy_cipher()
46 call_rcu(&ctx->rcu, tcp_fastopen_ctx_free); in tcp_fastopen_destroy_cipher()
62 struct tcp_fastopen_context *ctx, *octx; in tcp_fastopen_reset_cipher() local
66 ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); in tcp_fastopen_reset_cipher()
67 if (!ctx) { in tcp_fastopen_reset_cipher()
72 ctx->key[0].key[0] = get_unaligned_le64(primary_key); in tcp_fastopen_reset_cipher()
73 ctx->key[0].key[1] = get_unaligned_le64(primary_key + 8); in tcp_fastopen_reset_cipher()
75 ctx->key[1].key[0] = get_unaligned_le64(backup_key); in tcp_fastopen_reset_cipher()
76 ctx->key[1].key[1] = get_unaligned_le64(backup_key + 8); in tcp_fastopen_reset_cipher()
77 ctx->num = 2; in tcp_fastopen_reset_cipher()
79 ctx->num = 1; in tcp_fastopen_reset_cipher()
84 octx = unrcu_pointer(xchg(&q->ctx, RCU_INITIALIZER(ctx))); in tcp_fastopen_reset_cipher()
87 RCU_INITIALIZER(ctx))); in tcp_fastopen_reset_cipher()
99 struct tcp_fastopen_context *ctx; in tcp_fastopen_get_cipher() local
104 ctx = rcu_dereference(icsk->icsk_accept_queue.fastopenq.ctx); in tcp_fastopen_get_cipher()
106 ctx = rcu_dereference(net->ipv4.tcp_fastopen_ctx); in tcp_fastopen_get_cipher()
107 if (ctx) { in tcp_fastopen_get_cipher()
108 n_keys = tcp_fastopen_context_len(ctx); in tcp_fastopen_get_cipher()
110 put_unaligned_le64(ctx->key[i].key[0], key + (i * 2)); in tcp_fastopen_get_cipher()
111 put_unaligned_le64(ctx->key[i].key[1], key + (i * 2) + 1); in tcp_fastopen_get_cipher()
159 struct tcp_fastopen_context *ctx; in tcp_fastopen_cookie_gen() local
162 ctx = tcp_fastopen_get_ctx(sk); in tcp_fastopen_cookie_gen()
163 if (ctx) in tcp_fastopen_cookie_gen()
164 __tcp_fastopen_cookie_gen_cipher(req, syn, &ctx->key[0], foc); in tcp_fastopen_cookie_gen()
220 struct tcp_fastopen_context *ctx; in tcp_fastopen_cookie_gen_check() local
224 ctx = tcp_fastopen_get_ctx(sk); in tcp_fastopen_cookie_gen_check()
225 if (!ctx) in tcp_fastopen_cookie_gen_check()
227 for (i = 0; i < tcp_fastopen_context_len(ctx); i++) { in tcp_fastopen_cookie_gen_check()
228 __tcp_fastopen_cookie_gen_cipher(req, syn, &ctx->key[i], foc); in tcp_fastopen_cookie_gen_check()