Lines Matching refs:tls_ctx
157 struct tls_context *tls_ctx; in tls_decrypt_done() local
165 tls_ctx = tls_get_ctx(skb->sk); in tls_decrypt_done()
166 ctx = tls_sw_ctx_rx(tls_ctx); in tls_decrypt_done()
167 prot = &tls_ctx->prot_info; in tls_decrypt_done()
226 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_do_decryption() local
227 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_decryption()
228 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_do_decryption()
271 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_trim_both_msgs() local
272 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_trim_both_msgs()
273 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_trim_both_msgs()
284 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_alloc_encrypted_msg() local
285 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_alloc_encrypted_msg()
294 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_clone_plaintext_msg() local
295 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_clone_plaintext_msg()
296 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_clone_plaintext_msg()
318 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_get_rec() local
319 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_get_rec()
320 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_get_rec()
357 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_free_open_rec() local
358 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_free_open_rec()
369 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_tx_records() local
370 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_tx_records()
375 if (tls_is_partially_sent_record(tls_ctx)) { in tls_tx_records()
384 rc = tls_push_partial_record(sk, tls_ctx, tx_flags); in tls_tx_records()
405 rc = tls_push_sg(sk, tls_ctx, in tls_tx_records()
430 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_encrypt_done() local
431 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_encrypt_done()
432 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_encrypt_done()
488 struct tls_context *tls_ctx, in tls_do_encryption() argument
493 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_encryption()
505 memcpy(&rec->iv_data[iv_offset], tls_ctx->tx.iv, in tls_do_encryption()
508 xor_iv_with_seq(prot->version, rec->iv_data, tls_ctx->tx.rec_seq); in tls_do_encryption()
544 tls_advance_record_sn(sk, prot, &tls_ctx->tx); in tls_do_encryption()
669 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_push_record() local
670 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_record()
671 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_push_record()
751 tls_ctx->tx.rec_seq, prot->rec_seq_size, in tls_push_record()
754 tls_fill_prepend(tls_ctx, in tls_push_record()
760 tls_ctx->pending_open_record_frags = false; in tls_push_record()
762 rc = tls_do_encryption(sk, tls_ctx, ctx, req, in tls_push_record()
768 tls_ctx->pending_open_record_frags = true; in tls_push_record()
778 tls_ctx->pending_open_record_frags = true; in tls_push_record()
789 struct tls_context *tls_ctx = tls_get_ctx(sk); in bpf_exec_tx_verdict() local
790 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in bpf_exec_tx_verdict()
897 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_push_pending_record() local
898 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_push_pending_record()
918 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sendmsg() local
919 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_sendmsg()
920 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_sendmsg()
942 mutex_lock(&tls_ctx->tx_lock); in tls_sw_sendmsg()
1064 tls_ctx->pending_open_record_frags = true; in tls_sw_sendmsg()
1135 mutex_unlock(&tls_ctx->tx_lock); in tls_sw_sendmsg()
1143 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_do_sendpage() local
1144 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_do_sendpage()
1145 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_do_sendpage()
1212 tls_ctx->pending_open_record_frags = true; in tls_sw_do_sendpage()
1269 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_sendpage() local
1276 mutex_lock(&tls_ctx->tx_lock); in tls_sw_sendpage()
1280 mutex_unlock(&tls_ctx->tx_lock); in tls_sw_sendpage()
1287 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_wait_data() local
1288 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_wait_data()
1405 struct tls_context *tls_ctx = tls_get_ctx(sk); in decrypt_internal() local
1406 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in decrypt_internal()
1407 struct tls_prot_info *prot = &tls_ctx->prot_info; in decrypt_internal()
1475 memcpy(iv + iv_offset, tls_ctx->rx.iv, in decrypt_internal()
1478 memcpy(iv + iv_offset, tls_ctx->rx.iv, prot->salt_size); in decrypt_internal()
1480 xor_iv_with_seq(prot->version, iv, tls_ctx->rx.rec_seq); in decrypt_internal()
1485 tls_ctx->rx.rec_seq, prot->rec_seq_size, in decrypt_internal()
1541 struct tls_context *tls_ctx = tls_get_ctx(sk); in decrypt_skb_update() local
1542 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in decrypt_skb_update()
1543 struct tls_prot_info *prot = &tls_ctx->prot_info; in decrypt_skb_update()
1548 if (tls_ctx->rx_conf == TLS_HW) { in decrypt_skb_update()
1549 err = tls_device_decrypted(sk, tls_ctx, skb, rxm); in decrypt_skb_update()
1561 &tls_ctx->rx); in decrypt_skb_update()
1578 tls_advance_record_sn(sk, prot, &tls_ctx->rx); in decrypt_skb_update()
1600 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_advance_skb() local
1601 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_advance_skb()
1737 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_recvmsg() local
1738 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_recvmsg()
1739 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_recvmsg()
1981 struct tls_context *tls_ctx = tls_get_ctx(sock->sk); in tls_sw_splice_read() local
1982 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_splice_read()
2032 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_stream_read() local
2033 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_stream_read()
2049 struct tls_context *tls_ctx = tls_get_ctx(strp->sk); in tls_read_size() local
2050 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_read_size()
2051 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_read_size()
2111 struct tls_context *tls_ctx = tls_get_ctx(strp->sk); in tls_queue() local
2112 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_queue()
2124 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_data_ready() local
2125 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_data_ready()
2138 void tls_sw_cancel_work_tx(struct tls_context *tls_ctx) in tls_sw_cancel_work_tx() argument
2140 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_cancel_work_tx()
2149 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_release_resources_tx() local
2150 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_release_resources_tx()
2168 if (tls_ctx->partially_sent_record) { in tls_sw_release_resources_tx()
2169 tls_free_partial_record(sk, tls_ctx); in tls_sw_release_resources_tx()
2188 void tls_sw_free_ctx_tx(struct tls_context *tls_ctx) in tls_sw_free_ctx_tx() argument
2190 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx); in tls_sw_free_ctx_tx()
2197 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_release_resources_rx() local
2198 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_release_resources_rx()
2200 kfree(tls_ctx->rx.rec_seq); in tls_sw_release_resources_rx()
2201 kfree(tls_ctx->rx.iv); in tls_sw_release_resources_rx()
2221 void tls_sw_strparser_done(struct tls_context *tls_ctx) in tls_sw_strparser_done() argument
2223 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_strparser_done()
2228 void tls_sw_free_ctx_rx(struct tls_context *tls_ctx) in tls_sw_free_ctx_rx() argument
2230 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_free_ctx_rx()
2237 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_sw_free_resources_rx() local
2240 tls_sw_free_ctx_rx(tls_ctx); in tls_sw_free_resources_rx()
2250 struct tls_context *tls_ctx = tls_get_ctx(sk); in tx_work_handler() local
2253 if (unlikely(!tls_ctx)) in tx_work_handler()
2256 ctx = tls_sw_ctx_tx(tls_ctx); in tx_work_handler()
2262 mutex_lock(&tls_ctx->tx_lock); in tx_work_handler()
2266 mutex_unlock(&tls_ctx->tx_lock); in tx_work_handler()
2279 void tls_sw_strparser_arm(struct sock *sk, struct tls_context *tls_ctx) in tls_sw_strparser_arm() argument
2281 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx); in tls_sw_strparser_arm()
2293 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_set_sw_offload() local
2294 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_sw_offload()