diff options
author | David Goulet <dgoulet@ev0ke.net> | 2015-03-23 13:13:57 -0400 |
---|---|---|
committer | David Goulet <dgoulet@ev0ke.net> | 2015-04-21 14:22:54 -0400 |
commit | 917c3aac60a68c7bf6f29705e61a313fffb071d1 (patch) | |
tree | b76aa42344c5dca85ef6de86fc9df253507c41bd /src | |
parent | dd07c78524615738d9f326c34bea7b11bc1b1b88 (diff) | |
download | tor-917c3aac60a68c7bf6f29705e61a313fffb071d1.tar.gz tor-917c3aac60a68c7bf6f29705e61a313fffb071d1.zip |
Use rend_valid_service_id() in the HSFETCH command
Also, fix a small typo in a comment.
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c index 5cbc6ab619..10475bb271 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -38,6 +38,7 @@ #include "policies.h" #include "reasons.h" #include "rendclient.h" +#include "rendcommon.h" #include "rephist.h" #include "router.h" #include "routerlist.h" @@ -3281,9 +3282,7 @@ handle_control_hsfetch(control_connection_t *conn, uint32_t len, * rest to find optional argument(s). */ smartlist_del(args, 0); /* Test if it's an HS address without the .onion part. */ - if (strlen(arg1) == REND_SERVICE_ID_LEN_BASE32 && - base32_decode(digest, sizeof(digest), arg1, - REND_SERVICE_ID_LEN_BASE32) == 0) { + if (rend_valid_service_id(arg1)) { hsaddress = arg1; } else if (strstr(arg1, v2_str) && strlen(arg1 + v2_str_len) == REND_DESC_ID_V2_LEN_BASE32 && @@ -3349,7 +3348,7 @@ handle_control_hsfetch(control_connection_t *conn, uint32_t len, * to avoid out of order replies. */ send_control_done(conn); - /* Trigger the fetch using the built rend query and possibly a lit of HS + /* Trigger the fetch using the built rend query and possibly a list of HS * directory to use. This function ignores the client cache thus this will * always send a fetch command. */ rend_client_fetch_v2_desc(rend_query, hsdirs); |