Lines Matching refs:tls_ctx
194 struct tls_context *tls_ctx; in tls_decrypt_done() local
216 tls_ctx = tls_get_ctx(sk); in tls_decrypt_done()
217 ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_done()
260 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_do_decryption() local
261 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_decryption()
262 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_do_decryption()
309 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_trim_both_msgs() local
310 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_trim_both_msgs()
311 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_trim_both_msgs()
322 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_alloc_encrypted_msg() local
323 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_alloc_encrypted_msg()
332 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_clone_plaintext_msg() local
333 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_clone_plaintext_msg()
334 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_clone_plaintext_msg()
356 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_get_rec() local
357 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_get_rec()
358 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_get_rec()
397 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_free_open_rec() local
398 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_free_open_rec()
409 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_tx_records() local
410 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_tx_records()
415 if (tls_is_partially_sent_record(tls_ctx)) { in tls_tx_records()
424 rc = tls_push_partial_record(sk, tls_ctx, tx_flags); in tls_tx_records()
445 rc = tls_push_sg(sk, tls_ctx, in tls_tx_records()
469 struct tls_context *tls_ctx; in tls_encrypt_done() local
482 tls_ctx = tls_get_ctx(sk); in tls_encrypt_done()
483 prot = &tls_ctx->prot_info; in tls_encrypt_done()
484 ctx = tls_sw_ctx_tx(tls_ctx); in tls_encrypt_done()
534 struct tls_context *tls_ctx, in tls_do_encryption() argument
539 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_encryption()
557 memcpy(&rec->iv_data[iv_offset], tls_ctx->tx.iv, in tls_do_encryption()
561 tls_ctx->tx.rec_seq); in tls_do_encryption()
602 tls_advance_record_sn(sk, prot, &tls_ctx->tx); in tls_do_encryption()
727 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_push_record() local
728 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_record()
729 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_push_record()
809 tls_ctx->tx.rec_seq, record_type, prot); in tls_push_record()
811 tls_fill_prepend(tls_ctx, in tls_push_record()
817 tls_ctx->pending_open_record_frags = false; in tls_push_record()
819 rc = tls_do_encryption(sk, tls_ctx, ctx, req, in tls_push_record()
825 tls_ctx->pending_open_record_frags = true; in tls_push_record()
835 tls_ctx->pending_open_record_frags = true; in tls_push_record()
846 struct tls_context *tls_ctx = tls_get_ctx(sk); in bpf_exec_tx_verdict() local
847 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in bpf_exec_tx_verdict()
956 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_push_pending_record() local
957 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_push_pending_record()
1009 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sendmsg_locked() local
1010 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_sendmsg_locked()
1011 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_sendmsg_locked()
1093 tls_ctx->pending_open_record_frags = true; in tls_sw_sendmsg_locked()
1165 tls_ctx->pending_open_record_frags = true; in tls_sw_sendmsg_locked()
1228 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sendmsg() local
1236 ret = mutex_lock_interruptible(&tls_ctx->tx_lock); in tls_sw_sendmsg()
1242 mutex_unlock(&tls_ctx->tx_lock); in tls_sw_sendmsg()
1252 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_splice_eof() local
1253 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_splice_eof()
1263 mutex_lock(&tls_ctx->tx_lock); in tls_sw_splice_eof()
1304 mutex_unlock(&tls_ctx->tx_lock); in tls_sw_splice_eof()
1311 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_rx_rec_wait() local
1312 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_rx_rec_wait()
1469 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_decrypt_sg() local
1470 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_sg()
1471 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_decrypt_sg()
1547 memcpy(&dctx->iv[iv_offset], tls_ctx->rx.iv, in tls_decrypt_sg()
1555 memcpy(&dctx->iv[iv_offset], tls_ctx->rx.iv, prot->salt_size); in tls_decrypt_sg()
1557 tls_xor_iv_with_seq(prot, &dctx->iv[iv_offset], tls_ctx->rx.rec_seq); in tls_decrypt_sg()
1562 tls_ctx->rx.rec_seq, tlm->control, prot); in tls_decrypt_sg()
1638 tls_decrypt_sw(struct sock *sk, struct tls_context *tls_ctx, in tls_decrypt_sw() argument
1641 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_sw()
1642 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_decrypt_sw()
1661 return tls_decrypt_sw(sk, tls_ctx, msg, darg); in tls_decrypt_sw()
1679 struct tls_context *tls_ctx, struct tls_decrypt_arg *darg) in tls_decrypt_device() argument
1681 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_device()
1682 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_decrypt_device()
1686 if (tls_ctx->rx_conf != TLS_HW) in tls_decrypt_device()
1689 err = tls_device_decrypted(sk, tls_ctx); in tls_decrypt_device()
1760 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_rx_one_record() local
1761 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_rx_one_record()
1765 err = tls_decrypt_device(sk, msg, tls_ctx, darg); in tls_rx_one_record()
1767 err = tls_decrypt_sw(sk, tls_ctx, msg, darg); in tls_rx_one_record()
1774 tls_advance_record_sn(sk, prot, &tls_ctx->rx); in tls_rx_one_record()
1776 return tls_check_pending_rekey(sk, tls_ctx, darg->skb); in tls_rx_one_record()
1990 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_recvmsg() local
1991 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_recvmsg()
1992 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_recvmsg()
2212 struct tls_context *tls_ctx = tls_get_ctx(sock->sk); in tls_sw_splice_read() local
2213 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_splice_read()
2282 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_read_sock() local
2283 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_read_sock()
2284 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_read_sock()
2377 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sock_is_readable() local
2378 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_sock_is_readable()
2394 struct tls_context *tls_ctx = tls_get_ctx(strp->sk); in tls_rx_msg_size() local
2395 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_rx_msg_size()
2462 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_data_ready() local
2463 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_data_ready()
2482 void tls_sw_cancel_work_tx(struct tls_context *tls_ctx) in tls_sw_cancel_work_tx() argument
2484 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_cancel_work_tx()
2493 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_release_resources_tx() local
2494 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_release_resources_tx()
2505 if (tls_ctx->partially_sent_record) { in tls_sw_release_resources_tx()
2506 tls_free_partial_record(sk, tls_ctx); in tls_sw_release_resources_tx()
2525 void tls_sw_free_ctx_tx(struct tls_context *tls_ctx) in tls_sw_free_ctx_tx() argument
2527 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_free_ctx_tx()
2534 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_release_resources_rx() local
2535 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_release_resources_rx()
2553 void tls_sw_strparser_done(struct tls_context *tls_ctx) in tls_sw_strparser_done() argument
2555 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_strparser_done()
2560 void tls_sw_free_ctx_rx(struct tls_context *tls_ctx) in tls_sw_free_ctx_rx() argument
2562 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_free_ctx_rx()
2569 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_free_resources_rx() local
2572 tls_sw_free_ctx_rx(tls_ctx); in tls_sw_free_resources_rx()
2582 struct tls_context *tls_ctx = tls_get_ctx(sk); in tx_work_handler() local
2585 if (unlikely(!tls_ctx)) in tx_work_handler()
2588 ctx = tls_sw_ctx_tx(tls_ctx); in tx_work_handler()
2595 if (mutex_trylock(&tls_ctx->tx_lock)) { in tx_work_handler()
2599 mutex_unlock(&tls_ctx->tx_lock); in tx_work_handler()
2630 void tls_sw_strparser_arm(struct sock *sk, struct tls_context *tls_ctx) in tls_sw_strparser_arm() argument
2632 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_strparser_arm()
2640 void tls_update_rx_zc_capable(struct tls_context *tls_ctx) in tls_update_rx_zc_capable() argument
2642 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx); in tls_update_rx_zc_capable()
2644 rx_ctx->zc_capable = tls_ctx->rx_no_pad || in tls_update_rx_zc_capable()
2645 tls_ctx->prot_info.version != TLS_1_3_VERSION; in tls_update_rx_zc_capable()
2721 static void tls_finish_key_update(struct sock *sk, struct tls_context *tls_ctx) in tls_finish_key_update() argument
2723 struct tls_sw_context_rx *ctx = tls_ctx->priv_ctx_rx; in tls_finish_key_update()