Lines Matching refs:ctx
33 struct tcp_fastopen_context *ctx = in tcp_fastopen_ctx_free() local
35 crypto_free_cipher(ctx->tfm); in tcp_fastopen_ctx_free()
36 kfree(ctx); in tcp_fastopen_ctx_free()
42 struct tcp_fastopen_context *ctx, *octx; in tcp_fastopen_reset_cipher() local
44 ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); in tcp_fastopen_reset_cipher()
45 if (!ctx) in tcp_fastopen_reset_cipher()
47 ctx->tfm = crypto_alloc_cipher("aes", 0, 0); in tcp_fastopen_reset_cipher()
49 if (IS_ERR(ctx->tfm)) { in tcp_fastopen_reset_cipher()
50 err = PTR_ERR(ctx->tfm); in tcp_fastopen_reset_cipher()
51 error: kfree(ctx); in tcp_fastopen_reset_cipher()
55 err = crypto_cipher_setkey(ctx->tfm, key, len); in tcp_fastopen_reset_cipher()
58 crypto_free_cipher(ctx->tfm); in tcp_fastopen_reset_cipher()
61 memcpy(ctx->key, key, len); in tcp_fastopen_reset_cipher()
67 rcu_assign_pointer(tcp_fastopen_ctx, ctx); in tcp_fastopen_reset_cipher()
78 struct tcp_fastopen_context *ctx; in __tcp_fastopen_cookie_gen() local
82 ctx = rcu_dereference(tcp_fastopen_ctx); in __tcp_fastopen_cookie_gen()
83 if (ctx) { in __tcp_fastopen_cookie_gen()
84 crypto_cipher_encrypt_one(ctx->tfm, foc->val, path); in __tcp_fastopen_cookie_gen()