mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Clean up some uses of low-level control replies
Part of ticket 30889.
This commit is contained in:
parent
aec359ef62
commit
0dd59fdb56
@ -151,12 +151,8 @@ handle_control_authchallenge(control_connection_t *conn,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (args->kwargs == NULL || args->kwargs->next != NULL) {
|
if (args->kwargs == NULL || args->kwargs->next != NULL) {
|
||||||
/* connection_write_str_to_buf("512 AUTHCHALLENGE requires exactly "
|
control_write_endreply(conn, 512,
|
||||||
"2 arguments.\r\n", conn);
|
"Wrong number of arguments for AUTHCHALLENGE");
|
||||||
*/
|
|
||||||
control_printf_endreply(conn, 512,
|
|
||||||
"AUTHCHALLENGE dislikes argument list %s",
|
|
||||||
escaped(args->raw_body));
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (strcmp(args->kwargs->key, "")) {
|
if (strcmp(args->kwargs->key, "")) {
|
||||||
|
@ -703,9 +703,8 @@ handle_control_mapaddress(control_connection_t *conn,
|
|||||||
connection_buf_add(r, sz, TO_CONN(conn));
|
connection_buf_add(r, sz, TO_CONN(conn));
|
||||||
tor_free(r);
|
tor_free(r);
|
||||||
} else {
|
} else {
|
||||||
const char *response =
|
control_write_endreply(conn, 512, "syntax error: "
|
||||||
"512 syntax error: not enough arguments to mapaddress.\r\n";
|
"not enough arguments to mapaddress.");
|
||||||
connection_buf_add(response, strlen(response), TO_CONN(conn));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SMARTLIST_FOREACH(reply, char *, cp, tor_free(cp));
|
SMARTLIST_FOREACH(reply, char *, cp, tor_free(cp));
|
||||||
@ -845,7 +844,7 @@ handle_control_extendcircuit(control_connection_t *conn,
|
|||||||
"addresses that are allowed by the firewall configuration; "
|
"addresses that are allowed by the firewall configuration; "
|
||||||
"circuit marked for closing.");
|
"circuit marked for closing.");
|
||||||
circuit_mark_for_close(TO_CIRCUIT(circ), -END_CIRC_REASON_CONNECTFAILED);
|
circuit_mark_for_close(TO_CIRCUIT(circ), -END_CIRC_REASON_CONNECTFAILED);
|
||||||
connection_write_str_to_buf("551 Couldn't start circuit\r\n", conn);
|
control_write_endreply(conn, 551, "Couldn't start circuit");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
circuit_append_new_exit(circ, info);
|
circuit_append_new_exit(circ, info);
|
||||||
@ -1876,7 +1875,7 @@ handle_control_add_onion(control_connection_t *conn,
|
|||||||
char *encoded = rend_auth_encode_cookie(ac->descriptor_cookie,
|
char *encoded = rend_auth_encode_cookie(ac->descriptor_cookie,
|
||||||
auth_type);
|
auth_type);
|
||||||
tor_assert(encoded);
|
tor_assert(encoded);
|
||||||
connection_printf_to_buf(conn, "250-ClientAuth=%s:%s\r\n",
|
control_printf_midreply(conn, 250, "ClientAuth=%s:%s",
|
||||||
ac->client_name, encoded);
|
ac->client_name, encoded);
|
||||||
memwipe(encoded, 0, strlen(encoded));
|
memwipe(encoded, 0, strlen(encoded));
|
||||||
tor_free(encoded);
|
tor_free(encoded);
|
||||||
|
Loading…
Reference in New Issue
Block a user