diff options
author | David Goulet <dgoulet@ev0ke.net> | 2015-04-21 14:04:39 -0400 |
---|---|---|
committer | David Goulet <dgoulet@ev0ke.net> | 2015-04-22 09:28:20 -0400 |
commit | 6f5f38a0bc60d3be9b6cf02e29b9065869cf6af8 (patch) | |
tree | 991881106ef6f00304891d767272288c379e9a00 /src/or/routerparse.c | |
parent | a4585405d6e103b9a48a1401321477ea08fa2ad1 (diff) | |
download | tor-6f5f38a0bc60d3be9b6cf02e29b9065869cf6af8.tar.gz tor-6f5f38a0bc60d3be9b6cf02e29b9065869cf6af8.zip |
Add function to validate HS descriptor ID
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index fd3971c587..14d5f75e35 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -4572,8 +4572,7 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out, tok = find_by_keyword(tokens, R_RENDEZVOUS_SERVICE_DESCRIPTOR); tor_assert(tok == smartlist_get(tokens, 0)); tor_assert(tok->n_args == 1); - if (strlen(tok->args[0]) != REND_DESC_ID_V2_LEN_BASE32 || - strspn(tok->args[0], BASE32_CHARS) != REND_DESC_ID_V2_LEN_BASE32) { + if (!rend_valid_descriptor_id(tok->args[0])) { log_warn(LD_REND, "Invalid descriptor ID: '%s'", tok->args[0]); goto err; } |