commit c06efdd2c9f8bc6dfb74c47d366efed250efe373
parent 3e585d60479b0081a46a2593344fc785e81de249
Author: Nick Mathewson <nickm@torproject.org>
Date: Mon, 12 May 2025 08:44:44 -0400
reindent code from previous commit
Diffstat:
1 file changed, 25 insertions(+), 26 deletions(-)
diff --git 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);