Lines Matching refs:tls_ctx
191 struct tls_context *tls_ctx; in tls_decrypt_done() local
202 tls_ctx = tls_get_ctx(sk); in tls_decrypt_done()
203 ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_done()
239 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_do_decryption() local
240 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_decryption()
241 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_do_decryption()
275 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_trim_both_msgs() local
276 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_trim_both_msgs()
277 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_trim_both_msgs()
288 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_alloc_encrypted_msg() local
289 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_alloc_encrypted_msg()
298 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_clone_plaintext_msg() local
299 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_clone_plaintext_msg()
300 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_clone_plaintext_msg()
322 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_get_rec() local
323 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_get_rec()
324 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_get_rec()
363 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_free_open_rec() local
364 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_free_open_rec()
375 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_tx_records() local
376 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_tx_records()
381 if (tls_is_partially_sent_record(tls_ctx)) { in tls_tx_records()
390 rc = tls_push_partial_record(sk, tls_ctx, tx_flags); in tls_tx_records()
411 rc = tls_push_sg(sk, tls_ctx, in tls_tx_records()
435 struct tls_context *tls_ctx; in tls_encrypt_done() local
447 tls_ctx = tls_get_ctx(sk); in tls_encrypt_done()
448 prot = &tls_ctx->prot_info; in tls_encrypt_done()
449 ctx = tls_sw_ctx_tx(tls_ctx); in tls_encrypt_done()
497 struct tls_context *tls_ctx, in tls_do_encryption() argument
502 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_encryption()
520 memcpy(&rec->iv_data[iv_offset], tls_ctx->tx.iv, in tls_do_encryption()
524 tls_ctx->tx.rec_seq); in tls_do_encryption()
560 tls_advance_record_sn(sk, prot, &tls_ctx->tx); in tls_do_encryption()
685 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_push_record() local
686 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_record()
687 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_push_record()
767 tls_ctx->tx.rec_seq, record_type, prot); in tls_push_record()
769 tls_fill_prepend(tls_ctx, in tls_push_record()
775 tls_ctx->pending_open_record_frags = false; in tls_push_record()
777 rc = tls_do_encryption(sk, tls_ctx, ctx, req, in tls_push_record()
783 tls_ctx->pending_open_record_frags = true; in tls_push_record()
793 tls_ctx->pending_open_record_frags = true; in tls_push_record()
804 struct tls_context *tls_ctx = tls_get_ctx(sk); in bpf_exec_tx_verdict() local
805 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in bpf_exec_tx_verdict()
914 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_push_pending_record() local
915 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_push_pending_record()
935 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sendmsg() local
936 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_sendmsg()
937 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_sendmsg()
959 ret = mutex_lock_interruptible(&tls_ctx->tx_lock); in tls_sw_sendmsg()
1083 tls_ctx->pending_open_record_frags = true; in tls_sw_sendmsg()
1154 mutex_unlock(&tls_ctx->tx_lock); in tls_sw_sendmsg()
1162 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_do_sendpage() local
1163 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_do_sendpage()
1164 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_do_sendpage()
1231 tls_ctx->pending_open_record_frags = true; in tls_sw_do_sendpage()
1288 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sendpage() local
1295 ret = mutex_lock_interruptible(&tls_ctx->tx_lock); in tls_sw_sendpage()
1301 mutex_unlock(&tls_ctx->tx_lock); in tls_sw_sendpage()
1309 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_rx_rec_wait() local
1310 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_rx_rec_wait()
1459 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_decrypt_sg() local
1460 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_sg()
1461 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_decrypt_sg()
1537 memcpy(&dctx->iv[iv_offset], tls_ctx->rx.iv, in tls_decrypt_sg()
1545 memcpy(&dctx->iv[iv_offset], tls_ctx->rx.iv, prot->salt_size); in tls_decrypt_sg()
1547 tls_xor_iv_with_seq(prot, &dctx->iv[iv_offset], tls_ctx->rx.rec_seq); in tls_decrypt_sg()
1552 tls_ctx->rx.rec_seq, tlm->control, prot); in tls_decrypt_sg()
1621 tls_decrypt_sw(struct sock *sk, struct tls_context *tls_ctx, in tls_decrypt_sw() argument
1624 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_sw()
1625 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_decrypt_sw()
1644 return tls_decrypt_sw(sk, tls_ctx, msg, darg); in tls_decrypt_sw()
1662 struct tls_context *tls_ctx, struct tls_decrypt_arg *darg) in tls_decrypt_device() argument
1664 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_device()
1665 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_decrypt_device()
1669 if (tls_ctx->rx_conf != TLS_HW) in tls_decrypt_device()
1672 err = tls_device_decrypted(sk, tls_ctx); in tls_decrypt_device()
1713 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_rx_one_record() local
1714 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_rx_one_record()
1718 err = tls_decrypt_device(sk, msg, tls_ctx, darg); in tls_rx_one_record()
1720 err = tls_decrypt_sw(sk, tls_ctx, msg, darg); in tls_rx_one_record()
1727 tls_advance_record_sn(sk, prot, &tls_ctx->rx); in tls_rx_one_record()
1929 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_recvmsg() local
1930 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_recvmsg()
1931 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_recvmsg()
2150 struct tls_context *tls_ctx = tls_get_ctx(sock->sk); in tls_sw_splice_read() local
2151 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_splice_read()
2219 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sock_is_readable() local
2220 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_sock_is_readable()
2236 struct tls_context *tls_ctx = tls_get_ctx(strp->sk); in tls_rx_msg_size() local
2237 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_rx_msg_size()
2304 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_data_ready() local
2305 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_data_ready()
2320 void tls_sw_cancel_work_tx(struct tls_context *tls_ctx) in tls_sw_cancel_work_tx() argument
2322 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_cancel_work_tx()
2331 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_release_resources_tx() local
2332 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_release_resources_tx()
2350 if (tls_ctx->partially_sent_record) { in tls_sw_release_resources_tx()
2351 tls_free_partial_record(sk, tls_ctx); in tls_sw_release_resources_tx()
2370 void tls_sw_free_ctx_tx(struct tls_context *tls_ctx) in tls_sw_free_ctx_tx() argument
2372 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_free_ctx_tx()
2379 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_release_resources_rx() local
2380 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_release_resources_rx()
2382 kfree(tls_ctx->rx.rec_seq); in tls_sw_release_resources_rx()
2383 kfree(tls_ctx->rx.iv); in tls_sw_release_resources_rx()
2401 void tls_sw_strparser_done(struct tls_context *tls_ctx) in tls_sw_strparser_done() argument
2403 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_strparser_done()
2408 void tls_sw_free_ctx_rx(struct tls_context *tls_ctx) in tls_sw_free_ctx_rx() argument
2410 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_free_ctx_rx()
2417 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_free_resources_rx() local
2420 tls_sw_free_ctx_rx(tls_ctx); in tls_sw_free_resources_rx()
2430 struct tls_context *tls_ctx = tls_get_ctx(sk); in tx_work_handler() local
2433 if (unlikely(!tls_ctx)) in tx_work_handler()
2436 ctx = tls_sw_ctx_tx(tls_ctx); in tx_work_handler()
2443 if (mutex_trylock(&tls_ctx->tx_lock)) { in tx_work_handler()
2447 mutex_unlock(&tls_ctx->tx_lock); in tx_work_handler()
2478 void tls_sw_strparser_arm(struct sock *sk, struct tls_context *tls_ctx) in tls_sw_strparser_arm() argument
2480 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_strparser_arm()
2488 void tls_update_rx_zc_capable(struct tls_context *tls_ctx) in tls_update_rx_zc_capable() argument
2490 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx); in tls_update_rx_zc_capable()
2492 rx_ctx->zc_capable = tls_ctx->rx_no_pad || in tls_update_rx_zc_capable()
2493 tls_ctx->prot_info.version != TLS_1_3_VERSION; in tls_update_rx_zc_capable()
2498 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_set_sw_offload() local
2499 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_sw_offload()