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()
50 static int algif_skcipher_export(struct sock *sk, struct skcipher_request *req) in algif_skcipher_export() argument
52 struct alg_sock *ask = alg_sk(sk); in algif_skcipher_export()
69 ctx->state = sock_kmalloc(sk, statesize, GFP_ATOMIC); in algif_skcipher_export()
75 sock_kzfree_s(sk, ctx->state, statesize); in algif_skcipher_export()
85 struct sock *sk = areq->sk; in algif_skcipher_done() local
90 err = algif_skcipher_export(sk, &areq->cra_u.skcipher_req); in algif_skcipher_done()
99 struct sock *sk = sock->sk; in _skcipher_recvmsg() local
100 struct alg_sock *ask = alg_sk(sk); in _skcipher_recvmsg()
112 err = af_alg_wait_for_data(sk, flags, bs); in _skcipher_recvmsg()
118 areq = af_alg_alloc_areq(sk, sizeof(struct af_alg_async_req) + in _skcipher_recvmsg()
124 err = af_alg_get_rsgl(sk, msg, flags, areq, ctx->used, &len); in _skcipher_recvmsg()
141 areq->tsgl_entries = af_alg_count_tsgl(sk, len, 0); in _skcipher_recvmsg()
144 areq->tsgl = sock_kmalloc(sk, array_size(sizeof(*areq->tsgl), in _skcipher_recvmsg()
152 af_alg_pull_tsgl(sk, len, areq->tsgl, 0); in _skcipher_recvmsg()
162 sock_kzfree_s(sk, ctx->state, crypto_skcipher_statesize(tfm)); in _skcipher_recvmsg()
171 sock_hold(sk); in _skcipher_recvmsg()
189 sock_put(sk); in _skcipher_recvmsg()
204 sk, &areq->cra_u.skcipher_req); in _skcipher_recvmsg()
216 struct sock *sk = sock->sk; in skcipher_recvmsg() local
219 lock_sock(sk); in skcipher_recvmsg()
241 af_alg_wmem_wakeup(sk); in skcipher_recvmsg()
242 release_sock(sk); in skcipher_recvmsg()
271 struct sock *sk = sock->sk; in skcipher_check_key() local
272 struct alg_sock *ask = alg_sk(sk); in skcipher_check_key()
274 lock_sock(sk); in skcipher_check_key()
295 release_sock(sk); in skcipher_check_key()
358 static void skcipher_sock_destruct(struct sock *sk) in skcipher_sock_destruct() argument
360 struct alg_sock *ask = alg_sk(sk); in skcipher_sock_destruct()
366 af_alg_pull_tsgl(sk, ctx->used, NULL, 0); in skcipher_sock_destruct()
367 sock_kzfree_s(sk, ctx->iv, crypto_skcipher_ivsize(tfm)); in skcipher_sock_destruct()
369 sock_kzfree_s(sk, ctx->state, crypto_skcipher_statesize(tfm)); in skcipher_sock_destruct()
370 sock_kfree_s(sk, ctx, ctx->len); in skcipher_sock_destruct()
371 af_alg_release_parent(sk); in skcipher_sock_destruct()
374 static int skcipher_accept_parent_nokey(void *private, struct sock *sk) in skcipher_accept_parent_nokey() argument
377 struct alg_sock *ask = alg_sk(sk); in skcipher_accept_parent_nokey()
381 ctx = sock_kmalloc(sk, len, GFP_KERNEL); in skcipher_accept_parent_nokey()
386 ctx->iv = sock_kmalloc(sk, crypto_skcipher_ivsize(tfm), in skcipher_accept_parent_nokey()
389 sock_kfree_s(sk, ctx, len); in skcipher_accept_parent_nokey()
400 sk->sk_destruct = skcipher_sock_destruct; in skcipher_accept_parent_nokey()
405 static int skcipher_accept_parent(void *private, struct sock *sk) in skcipher_accept_parent() argument
412 return skcipher_accept_parent_nokey(private, sk); in skcipher_accept_parent()