torproject / tor Public
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tor Trac #28279]: control: Add a key to GETINFO to fetch the circuit onion handshake rephist values #1907
Conversation
Pull Request Test Coverage Report for Build 9333
|
| @@ -1436,6 +1437,37 @@ getinfo_helper_liveness(control_connection_t *control_conn, | |||
| return 0; | |||
| } | |||
|
|
|||
| /** Implementation helper for GETINFO: answers queries about shared random | |||
| * value. */ | |||
| result = | ||
| rep_hist_get_circuit_handshake_requested(ONION_HANDSHAKE_TYPE_TAP); | ||
| } | ||
| /* Else statement here is unrecognized key so do nothing. */ |
Shouldn't we send an error here? Spec specifies:
The server sends a 551 or 552 error on failure.
| { | ||
| (void) control_conn; | ||
| (void) errmsg; | ||
| int result = -1; |
I would not assign it here so the compiler can tell us when we use it unassigned. And I don't think we should ever use -1 as for an unknown question, an control error code should be returned?
| /** Get the circuit handshake value that is requested. */ | ||
| MOCK_IMPL(int, | ||
| rep_hist_get_circuit_handshake_requested, (uint16_t type)) | ||
| { |
We should be extra extra careful here with type so I would recommend you BUG() on type > MAX_ONION_HANDSHAKE_TYPE and return 0 as in "no stats".
| ITEM("rephist/tap/onion_handshakes_assigned", rephist, | ||
| "Assigned TAP circuit handshake stats."), | ||
| ITEM("rephist/tap/onion_handshakes_requested", rephist, | ||
| "Requested TAP circuit handshake stats."), |
See torspec comment about the naming. We'll wait on a decision there.
So, the PREFIX are not correct.
But also I would propose we use stats/ntor/requested and stats/ntor/assigned.
Reason I say that is that I think onion and handshake are a bit redundant since ntor is by definition an onion handshake.
…hake rephist values
…hake rephist values
…hake rephist values
…hake rephist values
…hake rephist values
Ticket: https://trac.torproject.org/projects/tor/ticket/28279
The text was updated successfully, but these errors were encountered: