aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-03-19 21:34:38 +0000
committerNick Mathewson <nickm@torproject.org>2003-03-19 21:34:38 +0000
commit4631f3dcdf43f21257e2081e6a42fdd841a6f878 (patch)
tree851682cab64c3f7a06fd0b65d2d839b01e50306e
parent3a89d27e66ffa28cffc9806ad68023d8cbc6c0d5 (diff)
downloadtor-4631f3dcdf43f21257e2081e6a42fdd841a6f878.tar.gz
tor-4631f3dcdf43f21257e2081e6a42fdd841a6f878.zip
Fix client_process_auth
svn:r202
-rw-r--r--src/or/connection_or.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index a28f97db57..aca9e746e0 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -375,7 +375,7 @@ connection_t *connection_or_connect_as_or(routerinfo_t *router) {
int or_handshake_client_send_auth(connection_t *conn) {
int retval;
- char buf[46];
+ char buf[48];
char cipher[128];
struct sockaddr_in me; /* my router identity */
@@ -439,7 +439,7 @@ int or_handshake_client_send_auth(connection_t *conn) {
}
int or_handshake_client_process_auth(connection_t *conn) {
- char buf[128]; /* only 48 of this is expected to be used */
+ char buf[128]; /* only 56 of this is expected to be used */
char cipher[128];
uint32_t bandwidth;
int retval;
@@ -468,7 +468,7 @@ int or_handshake_client_process_auth(connection_t *conn) {
crypto_perror());
return -1;
}
- else if (retval != 48)
+ else if (retval != 56)
{
log(LOG_ERR,"Received an incorrect response from router %s:%u during authentication.",
conn->address,conn->port);
@@ -496,7 +496,7 @@ int or_handshake_client_process_auth(connection_t *conn) {
conn->bandwidth = bandwidth;
/* reply is just local addr/port, remote addr/port, nonce */
- memcpy(buf+12, buf+32, 8);
+ memcpy(buf+12, buf+48, 8);
/* encrypt reply */
retval = crypto_pk_public_encrypt(conn->pkey, buf, 20, cipher,RSA_PKCS1_PADDING);