Lines Matching refs:sk
40 struct sock *sk = sock->sk; in skcipher_sendmsg() local
41 struct alg_sock *ask = alg_sk(sk); in skcipher_sendmsg()
53 struct sock *sk = sock->sk; in _skcipher_recvmsg() local
54 struct alg_sock *ask = alg_sk(sk); in _skcipher_recvmsg()
65 err = af_alg_wait_for_data(sk, flags, bs); in _skcipher_recvmsg()
71 areq = af_alg_alloc_areq(sk, sizeof(struct af_alg_async_req) + in _skcipher_recvmsg()
77 err = af_alg_get_rsgl(sk, msg, flags, areq, ctx->used, &len); in _skcipher_recvmsg()
92 areq->tsgl_entries = af_alg_count_tsgl(sk, len, 0); in _skcipher_recvmsg()
95 areq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl), in _skcipher_recvmsg()
103 af_alg_pull_tsgl(sk, len, areq->tsgl, 0); in _skcipher_recvmsg()
112 sock_hold(sk); in _skcipher_recvmsg()
129 sock_put(sk); in _skcipher_recvmsg()
152 struct sock *sk = sock->sk; in skcipher_recvmsg() local
155 lock_sock(sk); in skcipher_recvmsg()
177 af_alg_wmem_wakeup(sk); in skcipher_recvmsg()
178 release_sock(sk); in skcipher_recvmsg()
208 struct sock *sk = sock->sk; in skcipher_check_key() local
209 struct alg_sock *ask = alg_sk(sk); in skcipher_check_key()
211 lock_sock(sk); in skcipher_check_key()
232 release_sock(sk); in skcipher_check_key()
308 static void skcipher_sock_destruct(struct sock *sk) in skcipher_sock_destruct() argument
310 struct alg_sock *ask = alg_sk(sk); in skcipher_sock_destruct()
316 af_alg_pull_tsgl(sk, ctx->used, NULL, 0); in skcipher_sock_destruct()
317 sock_kzfree_s(sk, ctx->iv, crypto_skcipher_ivsize(tfm)); in skcipher_sock_destruct()
318 sock_kfree_s(sk, ctx, ctx->len); in skcipher_sock_destruct()
319 af_alg_release_parent(sk); in skcipher_sock_destruct()
322 static int skcipher_accept_parent_nokey(void *private, struct sock *sk) in skcipher_accept_parent_nokey() argument
325 struct alg_sock *ask = alg_sk(sk); in skcipher_accept_parent_nokey()
329 ctx = sock_kmalloc(sk, len, GFP_KERNEL); in skcipher_accept_parent_nokey()
334 ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm), in skcipher_accept_parent_nokey()
337 sock_kfree_s(sk, ctx, len); in skcipher_accept_parent_nokey()
348 sk->sk_destruct = skcipher_sock_destruct; in skcipher_accept_parent_nokey()
353 static int skcipher_accept_parent(void *private, struct sock *sk) in skcipher_accept_parent() argument
360 return skcipher_accept_parent_nokey(private, sk); in skcipher_accept_parent()