aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_circuit.c
diff options
context:
space:
mode:
authorMicah Elizabeth Scott <beth@torproject.org>2023-04-26 15:29:04 -0700
committerMicah Elizabeth Scott <beth@torproject.org>2023-05-10 07:41:37 -0700
commit138fd5707258fb2d6768e93587ac2ae547acdf18 (patch)
tree2c2176f8165588d5985ab98be8b7ab7f86a9e343 /src/feature/hs/hs_circuit.c
parent971de27c0744deac7017d8da720eea39ad960a6f (diff)
downloadtor-138fd5707258fb2d6768e93587ac2ae547acdf18.tar.gz
tor-138fd5707258fb2d6768e93587ac2ae547acdf18.zip
hs_pow: add per-circuit effort information to control port
This lets controller apps see the outgoing PoW effort on client circuits, and the validated effort received on an incoming service circuit. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r--src/feature/hs/hs_circuit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index ccd6711041..9311a26169 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -429,6 +429,13 @@ launch_rendezvous_point_circuit,(const hs_service_t *service,
tor_assert(circ->hs_ident);
}
+ /* Remember PoW state if this introduction included a valid proof of work
+ * client puzzle extension. */
+ if (rdv_data->pow_effort > 0) {
+ circ->hs_pow_effort = rdv_data->pow_effort;
+ circ->hs_with_pow_circ = 1;
+ }
+
/* Setup congestion control if asked by the client from the INTRO cell. */
if (rdv_data->cc_enabled) {
hs_circ_setup_congestion_control(circ, congestion_control_sendme_inc(),