summaryrefslogtreecommitdiff
path: root/src/feature/control
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/control
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/control')
-rw-r--r--src/feature/control/control_fmt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/feature/control/control_fmt.c b/src/feature/control/control_fmt.c
index cc8686818a..b6efd18163 100644
--- a/src/feature/control/control_fmt.c
+++ b/src/feature/control/control_fmt.c
@@ -153,6 +153,13 @@ circuit_describe_status_for_controller(origin_circuit_t *circ)
tor_free(socks_password_escaped);
}
+ /* Attach the proof-of-work solution effort, if it's nonzero. Clients set
+ * this to the effort they've chosen, services set this to a value that
+ * was provided by the client and then verified by the service. */
+ if (circ->hs_pow_effort > 0) {
+ smartlist_add_asprintf(descparts, "HS_POW=v1,%u", circ->hs_pow_effort);
+ }
+
rv = smartlist_join_strings(descparts, " ", 0, NULL);
SMARTLIST_FOREACH(descparts, char *, cp, tor_free(cp));