diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-01-03 12:00:59 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-01-03 12:00:59 -0500 |
commit | c5382255bd1f16b718885d4680d28a85d297f117 (patch) | |
tree | 87cd3bdb912a8958f537af8d3b81fe84aec09c78 /src/or | |
parent | a1ceee193bf2017bd7d2115cfa1d718409c11929 (diff) | |
parent | 40ef9087cf7960ce00cd82aa49309f47c9eb064c (diff) | |
download | tor-c5382255bd1f16b718885d4680d28a85d297f117.tar.gz tor-c5382255bd1f16b718885d4680d28a85d297f117.zip |
Merge remote branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/circuitbuild.c | 5 | ||||
-rw-r--r-- | src/or/command.c | 3 | ||||
-rw-r--r-- | src/or/onion.c | 4 | ||||
-rw-r--r-- | src/or/rendmid.c | 6 | ||||
-rw-r--r-- | src/or/rephist.c | 3 |
5 files changed, 13 insertions, 8 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 27b28040d7..d4505c29f9 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2077,7 +2077,8 @@ circuit_extend(cell_t *cell, circuit_t *circ) n_addr32 = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE)); n_port = ntohs(get_uint16(cell->payload+RELAY_HEADER_SIZE+4)); onionskin = (char*) cell->payload+RELAY_HEADER_SIZE+4+2; - id_digest = (char*) cell->payload+RELAY_HEADER_SIZE+4+2+ONIONSKIN_CHALLENGE_LEN; + id_digest = (char*) cell->payload+RELAY_HEADER_SIZE+4+2+ + ONIONSKIN_CHALLENGE_LEN; tor_addr_from_ipv4h(&n_addr, n_addr32); if (!n_port || !n_addr32) { @@ -2232,7 +2233,7 @@ circuit_finish_handshake(origin_circuit_t *circ, uint8_t reply_type, tor_assert(hop->state == CPATH_STATE_AWAITING_KEYS); if (reply_type == CELL_CREATED && hop->dh_handshake_state) { - if (onion_skin_client_handshake(hop->dh_handshake_state, (char*)reply, keys, + if (onion_skin_client_handshake(hop->dh_handshake_state, (char*)reply,keys, DIGEST_LEN*2+CIPHER_KEY_LEN*2) < 0) { log_warn(LD_CIRC,"onion_skin_client_handshake failed."); return -END_CIRC_REASON_TORPROTOCOL; diff --git a/src/or/command.c b/src/or/command.c index 7fe9169c3d..4b70deeef4 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -604,7 +604,8 @@ command_process_netinfo_cell(cell_t *cell, or_connection_t *conn) /* Consider all the other addresses; if any matches, this connection is * "canonical." */ tor_addr_t addr; - const uint8_t *next = decode_address_from_payload(&addr, cp, (int)(end-cp)); + const uint8_t *next = + decode_address_from_payload(&addr, cp, (int)(end-cp)); if (next == NULL) { log_fn(LOG_PROTOCOL_WARN, LD_OR, "Bad address in netinfo cell; closing connection."); diff --git a/src/or/onion.c b/src/or/onion.c index b8f3019e19..9db9145c78 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -392,8 +392,8 @@ fast_server_handshake(const uint8_t *key_in, /* DIGEST_LEN bytes */ * and protected by TLS). */ int -fast_client_handshake(const uint8_t *handshake_state, /* DIGEST_LEN bytes */ - const uint8_t *handshake_reply_out, /* DIGEST_LEN*2 bytes */ +fast_client_handshake(const uint8_t *handshake_state,/*DIGEST_LEN bytes*/ + const uint8_t *handshake_reply_out,/*DIGEST_LEN*2 bytes*/ uint8_t *key_out, size_t key_out_len) { diff --git a/src/or/rendmid.c b/src/or/rendmid.c index baa83293d9..5e2dd986ba 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -69,7 +69,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request, } /* Rest of body: signature of previous data */ note_crypto_pk_op(REND_MID); - if (crypto_pk_public_checksig_digest(pk, (char*)request, 2+asn1len+DIGEST_LEN, + if (crypto_pk_public_checksig_digest(pk, + (char*)request, 2+asn1len+DIGEST_LEN, (char*)(request+2+DIGEST_LEN+asn1len), request_len-(2+DIGEST_LEN+asn1len))<0) { log_warn(LD_PROTOCOL, @@ -130,7 +131,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request, * INTRODUCE2 cell. */ int -rend_mid_introduce(or_circuit_t *circ, const uint8_t *request, size_t request_len) +rend_mid_introduce(or_circuit_t *circ, const uint8_t *request, + size_t request_len) { or_circuit_t *intro_circ; char serviceid[REND_SERVICE_ID_LEN_BASE32+1]; diff --git a/src/or/rephist.c b/src/or/rephist.c index a1f3147175..236cbabf30 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1983,7 +1983,8 @@ rep_hist_exit_stats_term(void) /** Helper for qsort: compare two ints. */ static int -_compare_int(const void *x, const void *y) { +_compare_int(const void *x, const void *y) +{ return (*(int*)x - *(int*)y); } |