Lines Matching refs:tls_ctx
194 struct tls_context *tls_ctx;
216 tls_ctx = tls_get_ctx(sk);
217 ctx = tls_sw_ctx_rx(tls_ctx);
260 struct tls_context *tls_ctx = tls_get_ctx(sk);
261 struct tls_prot_info *prot = &tls_ctx->prot_info;
262 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
309 struct tls_context *tls_ctx = tls_get_ctx(sk);
310 struct tls_prot_info *prot = &tls_ctx->prot_info;
311 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
322 struct tls_context *tls_ctx = tls_get_ctx(sk);
323 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
332 struct tls_context *tls_ctx = tls_get_ctx(sk);
333 struct tls_prot_info *prot = &tls_ctx->prot_info;
334 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
356 struct tls_context *tls_ctx = tls_get_ctx(sk);
357 struct tls_prot_info *prot = &tls_ctx->prot_info;
358 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
397 struct tls_context *tls_ctx = tls_get_ctx(sk);
398 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
409 struct tls_context *tls_ctx = tls_get_ctx(sk);
410 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
415 if (tls_is_partially_sent_record(tls_ctx)) {
424 rc = tls_push_partial_record(sk, tls_ctx, tx_flags);
445 rc = tls_push_sg(sk, tls_ctx,
469 struct tls_context *tls_ctx;
482 tls_ctx = tls_get_ctx(sk);
483 prot = &tls_ctx->prot_info;
484 ctx = tls_sw_ctx_tx(tls_ctx);
534 struct tls_context *tls_ctx,
539 struct tls_prot_info *prot = &tls_ctx->prot_info;
557 memcpy(&rec->iv_data[iv_offset], tls_ctx->tx.iv,
561 tls_ctx->tx.rec_seq);
602 tls_advance_record_sn(sk, prot, &tls_ctx->tx);
727 struct tls_context *tls_ctx = tls_get_ctx(sk);
728 struct tls_prot_info *prot = &tls_ctx->prot_info;
729 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
809 tls_ctx->tx.rec_seq, record_type, prot);
811 tls_fill_prepend(tls_ctx,
817 tls_ctx->pending_open_record_frags = false;
819 rc = tls_do_encryption(sk, tls_ctx, ctx, req,
825 tls_ctx->pending_open_record_frags = true;
835 tls_ctx->pending_open_record_frags = true;
846 struct tls_context *tls_ctx = tls_get_ctx(sk);
847 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
956 struct tls_context *tls_ctx = tls_get_ctx(sk);
957 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
1009 struct tls_context *tls_ctx = tls_get_ctx(sk);
1010 struct tls_prot_info *prot = &tls_ctx->prot_info;
1011 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
1093 tls_ctx->pending_open_record_frags = true;
1165 tls_ctx->pending_open_record_frags = true;
1228 struct tls_context *tls_ctx = tls_get_ctx(sk);
1236 ret = mutex_lock_interruptible(&tls_ctx->tx_lock);
1242 mutex_unlock(&tls_ctx->tx_lock);
1252 struct tls_context *tls_ctx = tls_get_ctx(sk);
1253 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
1263 mutex_lock(&tls_ctx->tx_lock);
1304 mutex_unlock(&tls_ctx->tx_lock);
1311 struct tls_context *tls_ctx = tls_get_ctx(sk);
1312 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
1465 struct tls_context *tls_ctx = tls_get_ctx(sk);
1466 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
1467 struct tls_prot_info *prot = &tls_ctx->prot_info;
1543 memcpy(&dctx->iv[iv_offset], tls_ctx->rx.iv,
1551 memcpy(&dctx->iv[iv_offset], tls_ctx->rx.iv, prot->salt_size);
1553 tls_xor_iv_with_seq(prot, &dctx->iv[iv_offset], tls_ctx->rx.rec_seq);
1558 tls_ctx->rx.rec_seq, tlm->control, prot);
1634 tls_decrypt_sw(struct sock *sk, struct tls_context *tls_ctx,
1637 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
1638 struct tls_prot_info *prot = &tls_ctx->prot_info;
1657 return tls_decrypt_sw(sk, tls_ctx, msg, darg);
1675 struct tls_context *tls_ctx, struct tls_decrypt_arg *darg)
1677 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
1678 struct tls_prot_info *prot = &tls_ctx->prot_info;
1682 if (tls_ctx->rx_conf != TLS_HW)
1685 err = tls_device_decrypted(sk, tls_ctx);
1726 struct tls_context *tls_ctx = tls_get_ctx(sk);
1727 struct tls_prot_info *prot = &tls_ctx->prot_info;
1731 err = tls_decrypt_device(sk, msg, tls_ctx, darg);
1733 err = tls_decrypt_sw(sk, tls_ctx, msg, darg);
1740 tls_advance_record_sn(sk, prot, &tls_ctx->rx);
1956 struct tls_context *tls_ctx = tls_get_ctx(sk);
1957 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
1958 struct tls_prot_info *prot = &tls_ctx->prot_info;
2176 struct tls_context *tls_ctx = tls_get_ctx(sock->sk);
2177 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2246 struct tls_context *tls_ctx = tls_get_ctx(sk);
2247 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2248 struct tls_prot_info *prot = &tls_ctx->prot_info;
2341 struct tls_context *tls_ctx = tls_get_ctx(sk);
2342 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2358 struct tls_context *tls_ctx = tls_get_ctx(strp->sk);
2359 struct tls_prot_info *prot = &tls_ctx->prot_info;
2426 struct tls_context *tls_ctx = tls_get_ctx(sk);
2427 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2446 void tls_sw_cancel_work_tx(struct tls_context *tls_ctx)
2448 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
2457 struct tls_context *tls_ctx = tls_get_ctx(sk);
2458 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
2469 if (tls_ctx->partially_sent_record) {
2470 tls_free_partial_record(sk, tls_ctx);
2489 void tls_sw_free_ctx_tx(struct tls_context *tls_ctx)
2491 struct tls_sw_context_tx *ctx = tls_sw_ctx_tx(tls_ctx);
2498 struct tls_context *tls_ctx = tls_get_ctx(sk);
2499 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2501 kfree(tls_ctx->rx.rec_seq);
2502 kfree(tls_ctx->rx.iv);
2520 void tls_sw_strparser_done(struct tls_context *tls_ctx)
2522 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2527 void tls_sw_free_ctx_rx(struct tls_context *tls_ctx)
2529 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
2536 struct tls_context *tls_ctx = tls_get_ctx(sk);
2539 tls_sw_free_ctx_rx(tls_ctx);
2549 struct tls_context *tls_ctx = tls_get_ctx(sk);
2552 if (unlikely(!tls_ctx))
2555 ctx = tls_sw_ctx_tx(tls_ctx);
2562 if (mutex_trylock(&tls_ctx->tx_lock)) {
2566 mutex_unlock(&tls_ctx->tx_lock);
2597 void tls_sw_strparser_arm(struct sock *sk, struct tls_context *tls_ctx)
2599 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx);
2607 void tls_update_rx_zc_capable(struct tls_context *tls_ctx)
2609 struct tls_sw_context_rx *rx_ctx = tls_sw_ctx_rx(tls_ctx);
2611 rx_ctx->zc_capable = tls_ctx->rx_no_pad ||
2612 tls_ctx->prot_info.version != TLS_1_3_VERSION;
2659 struct tls_context *tls_ctx = tls_get_ctx(sk);
2660 struct tls_prot_info *prot = &tls_ctx->prot_info;