diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-09 09:42:51 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-25 14:13:03 -0400 |
commit | ba05324242aebdbf646ebb8e8f3aaef45b1f29ec (patch) | |
tree | e8d0ac79fb001e6cc391eb6173d4f921a7e9b559 /src/feature/control/control_auth.c | |
parent | 0c0b869ba450363e36e8dd0bdacb4a197e0f0019 (diff) | |
download | tor-ba05324242aebdbf646ebb8e8f3aaef45b1f29ec.tar.gz tor-ba05324242aebdbf646ebb8e8f3aaef45b1f29ec.zip |
Move and rename decode_escaped_string()
This function decodes something different from the usual c-escaped
format.
It is only used in controller authorization.
Diffstat (limited to 'src/feature/control/control_auth.c')
-rw-r--r-- | src/feature/control/control_auth.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/feature/control/control_auth.c b/src/feature/control/control_auth.c index 927115a308..8204290489 100644 --- a/src/feature/control/control_auth.c +++ b/src/feature/control/control_auth.c @@ -17,6 +17,7 @@ #include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_util.h" #include "lib/encoding/confline.h" +#include "lib/encoding/qstring.h" #include "lib/crypt_ops/crypto_s2k.h" @@ -149,8 +150,8 @@ handle_control_authchallenge(control_connection_t *conn, uint32_t len, cp += strspn(cp, " \t\n\r"); if (*cp == '"') { const char *newcp = - decode_escaped_string(cp, len - (cp - body), - &client_nonce, &client_nonce_len); + decode_qstring(cp, len - (cp - body), + &client_nonce, &client_nonce_len); if (newcp == NULL) { connection_write_str_to_buf("513 Invalid quoted client nonce\r\n", conn); @@ -275,7 +276,7 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len, return 0; } } else { - if (!decode_escaped_string(body, len, &password, &password_len)) { + if (!decode_qstring(body, len, &password, &password_len)) { connection_write_str_to_buf("551 Invalid quoted string. You need " "to put the password in double quotes.\r\n", conn); connection_mark_for_close(TO_CONN(conn)); |