Fix a bunch of whitespace errors

This commit is contained in:
Nick Mathewson 2011-10-11 11:30:01 -04:00
parent 3b704fd166
commit 69921837a7
8 changed files with 27 additions and 22 deletions

View File

@ -111,7 +111,8 @@ struct bufferevent *tor_tls_init_bufferevent(tor_tls_t *tls,
#endif
void tor_cert_free(tor_cert_t *cert);
tor_cert_t *tor_cert_decode(const uint8_t *certificate, size_t certificate_len);
tor_cert_t *tor_cert_decode(const uint8_t *certificate,
size_t certificate_len);
void tor_cert_get_der(const tor_cert_t *cert,
const uint8_t **encoded_out, size_t *size_out);
const digests_t *tor_cert_get_id_digests(const tor_cert_t *cert);

View File

@ -1005,14 +1005,15 @@ fetch_from_buf(char *string, size_t string_len, buf_t *buf)
return (int)buf->datalen;
}
/** True iff the cell command <b>command</b> is one that implies a variable-length
* cell in Tor link protocol <b>linkproto</b>. */
/** True iff the cell command <b>command</b> is one that implies a
* variable-length cell in Tor link protocol <b>linkproto</b>. */
static inline int
cell_command_is_var_length(uint8_t command, int linkproto)
{
/* If linkproto is v2 (2), CELL_VERSIONS is the only variable-length cells work as
* implemented here. If it's 1, there are no variable-length cells. Tor
* does not support other versions right now, and so can't negotiate them.
/* If linkproto is v2 (2), CELL_VERSIONS is the only variable-length cells
* work as implemented here. If it's 1, there are no variable-length cells.
* Tor does not support other versions right now, and so can't negotiate
* them.
*/
switch (linkproto) {
case 1:

View File

@ -1016,7 +1016,6 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
if (! tor_tls_cert_is_valid(id_cert, id_cert, 1))
ERR("The ID certificate was not valid");
log_info(LD_OR, "Got some good certificates from %s:%d: "
"Waiting for AUTHENTICATE.",
safe_str(conn->_base.address), conn->_base.port);
@ -1026,7 +1025,7 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
}
conn->handshake_state->received_cert_cell = 1;
err:
err:
tor_cert_free(id_cert);
tor_cert_free(link_cert);
tor_cert_free(auth_cert);
@ -1100,7 +1099,8 @@ command_process_auth_challenge_cell(var_cell_t *cell, or_connection_t *conn)
return;
}
} else {
log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Not authenticating",
log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Not "
"authenticating",
safe_str(conn->_base.address), conn->_base.port);
}
#undef ERR

View File

@ -5134,9 +5134,9 @@ warn_nonlocal_client_ports(const smartlist_t *ports, const char *portname)
"use it as an open proxy. Please don't allow this unless you "
"have a good reason.", portname);
} else if (!tor_addr_is_loopback(&port->addr)) {
log_notice(LD_CONFIG, "You configured a non-loopback address for %sPort. "
"This allows everybody on your local network to use your "
"machine as a proxy. Make sure this is what you wanted.",
log_notice(LD_CONFIG, "You configured a non-loopback address for "
"%sPort. This allows everybody on your local network to use "
"your machine as a proxy. Make sure this is what you wanted.",
portname);
}
} SMARTLIST_FOREACH_END(port);

View File

@ -1185,8 +1185,8 @@ connection_tls_continue_handshake(or_connection_t *conn)
"handshake.");
return connection_or_launch_v3_or_handshake(conn);
} else {
log_debug(LD_OR, "Done with initial SSL handshake (client-side). "
"Requesting renegotiation.");
log_debug(LD_OR, "Done with initial SSL handshake (client-side)."
" Requesting renegotiation.");
conn->_base.state = OR_CONN_STATE_TLS_CLIENT_RENEGOTIATING;
goto again;
}
@ -1564,7 +1564,6 @@ connection_or_launch_v3_or_handshake(or_connection_t *conn)
return connection_or_send_versions(conn, 1);
}
/** Allocate a new connection handshake state for the connection
* <b>conn</b>. Return 0 on success, -1 on failure. */
int
@ -1964,8 +1963,8 @@ connection_or_send_cert_cell(or_connection_t *conn)
tor_cert_get_der(link_cert, &link_encoded, &link_len);
tor_cert_get_der(id_cert, &id_encoded, &id_len);
cell_len = 1 /* 1 octet: num certs in cell */ +
2 * ( 1 + 2 ) /* For each cert: 1 octet for type, 2 for length */ +
cell_len = 1 /* 1 byte: num certs in cell */ +
2 * ( 1 + 2 ) /* For each cert: 1 byte for type, 2 for length */ +
link_len + id_len;
cell = var_cell_new(cell_len);
cell->command = CELL_CERT;
@ -2178,7 +2177,7 @@ connection_or_send_authenticate_cell(or_connection_t *conn, int authtype)
/* XXXX make sure we're actually supposed to send this! */
if (!pk) {
log_warn(LD_BUG, "Unable to compute authenticate cell: no client auth key");
log_warn(LD_BUG, "Can't compute authenticate cell: no client auth key");
return -1;
}
if (authtype != AUTHTYPE_RSA_SHA256_TLSSECRET) {
@ -2216,3 +2215,4 @@ connection_or_send_authenticate_cell(or_connection_t *conn, int authtype)
return 0;
}

View File

@ -41,9 +41,11 @@ void connection_or_report_broken_states(int severity, int domain);
int connection_tls_start_handshake(or_connection_t *conn, int receiving);
int connection_tls_continue_handshake(or_connection_t *conn);
int connection_init_or_handshake_state(or_connection_t *conn, int started_here);
int connection_init_or_handshake_state(or_connection_t *conn,
int started_here);
void connection_or_init_conn_from_address(or_connection_t *conn,
const tor_addr_t *addr, uint16_t port,
const tor_addr_t *addr,
uint16_t port,
const char *id_digest,
int started_here);
int connection_or_client_learned_peer_id(or_connection_t *conn,

View File

@ -1017,3 +1017,4 @@ hibernate_set_state_for_testing_(hibernate_state_t newstate)
{
hibernate_state = newstate;
}

View File

@ -366,8 +366,8 @@ rend_client_introduction_acked(origin_circuit_t *circ,
safe_str_client(circ->rend_data->onion_address),
safe_str_client(extend_info_describe(circ->build_state->chosen_exit)));
if (rend_client_report_intro_point_failure(circ->build_state->chosen_exit,
circ->rend_data,
INTRO_POINT_FAILURE_GENERIC)>0){
circ->rend_data,
INTRO_POINT_FAILURE_GENERIC)>0) {
/* There are introduction points left. Re-extend the circuit to
* another intro point and try again. */
int result = rend_client_reextend_intro_circuit(circ);