summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-04-11 16:51:10 -0400
committerSebastian Hahn <sebastian@torproject.org>2011-11-16 18:14:03 +0100
commit67650a869db43f90aa8aa4b7a605afa99ddbd557 (patch)
treeaef33b836a2a23c1301d0606b90b3ee6984c3bb2 /src
parentc4a4ac7de6d32482fad36ce5af9b1e932cd506cb (diff)
downloadtor-67650a869db43f90aa8aa4b7a605afa99ddbd557.tar.gz
tor-67650a869db43f90aa8aa4b7a605afa99ddbd557.zip
allow manual control port authenticate via netcat
Diffstat (limited to 'src')
-rw-r--r--src/or/control.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 7785ec5f3f..4d86a23759 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1055,7 +1055,10 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
int bad_cookie=0, bad_password=0;
smartlist_t *sl = NULL;
- if (TOR_ISXDIGIT(body[0])) {
+ if (!len || TOR_ISSPACE(body[0])) {
+ password = tor_strdup("");
+ password_len = 0;
+ } else if (TOR_ISXDIGIT(body[0])) {
cp = body;
while (TOR_ISXDIGIT(*cp))
++cp;
@@ -1072,9 +1075,6 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
tor_free(password);
return 0;
}
- } else if (TOR_ISSPACE(body[0])) {
- password = tor_strdup("");
- password_len = 0;
} else {
if (!decode_escaped_string(body, len, &password, &password_len)) {
connection_write_str_to_buf("551 Invalid quoted string. You need "