From: Nick Mathewson Date: Mon, 12 May 2025 12:44:44 +0000 (-0400) Subject: reindent code from previous commit X-Git-Tag: tor-0.4.8.17~7^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c06efdd2c9f8bc6dfb74c47d366efed250efe373;p=thirdparty%2Ftor.git reindent code from previous commit --- diff --git a/src/feature/hs/hs_descriptor.c b/src/feature/hs/hs_descriptor.c index 5131ae0720..e63d34c6e9 100644 --- a/src/feature/hs/hs_descriptor.c +++ b/src/feature/hs/hs_descriptor.c @@ -2119,7 +2119,6 @@ decode_pow_params(const smartlist_t *toks, if (!toks) return 0; - // XXXX reindent. SMARTLIST_FOREACH_BEGIN(toks, const directory_token_t *, tok) { tor_assert(tok->n_args >= 1); @@ -2142,34 +2141,34 @@ decode_pow_params(const smartlist_t *toks, *pow_params_out = pow_params; pow_params->type = HS_POW_DESC_V1; - if (base64_decode((char *)pow_params->seed, sizeof(pow_params->seed), - tok->args[1], strlen(tok->args[1])) != - sizeof(pow_params->seed)) { - log_warn(LD_REND, "Unparseable seed %s in PoW params", - escaped(tok->args[1])); - goto done; - } + if (base64_decode((char *)pow_params->seed, sizeof(pow_params->seed), + tok->args[1], strlen(tok->args[1])) != + sizeof(pow_params->seed)) { + log_warn(LD_REND, "Unparseable seed %s in PoW params", + escaped(tok->args[1])); + goto done; + } - int ok; - unsigned long effort = + int ok; + unsigned long effort = tor_parse_ulong(tok->args[2], 10, 0, UINT32_MAX, &ok, NULL); - if (!ok) { - log_warn(LD_REND, "Unparseable suggested effort %s in PoW params", - escaped(tok->args[2])); - goto done; - } - pow_params->suggested_effort = (uint32_t)effort; + if (!ok) { + log_warn(LD_REND, "Unparseable suggested effort %s in PoW params", + escaped(tok->args[2])); + goto done; + } + pow_params->suggested_effort = (uint32_t)effort; - /* Parse the expiration time of the PoW params. */ - time_t expiration_time = 0; - if (parse_iso_time_nospace(tok->args[3], &expiration_time)) { - log_warn(LD_REND, "Unparseable expiration time %s in PoW params", - escaped(tok->args[3])); - goto done; - } - /* Validation of this time is done in client_desc_has_arrived() so we can - * trigger a fetch if expired. */ - pow_params->expiration_time = expiration_time; + /* Parse the expiration time of the PoW params. */ + time_t expiration_time = 0; + if (parse_iso_time_nospace(tok->args[3], &expiration_time)) { + log_warn(LD_REND, "Unparseable expiration time %s in PoW params", + escaped(tok->args[3])); + goto done; + } + /* Validation of this time is done in client_desc_has_arrived() so we can + * trigger a fetch if expired. */ + pow_params->expiration_time = expiration_time; } SMARTLIST_FOREACH_END(tok);