]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs_pow: fix assert in services that receive unsolicited proof of work
authorMicah Elizabeth Scott <beth@torproject.org>
Tue, 14 Mar 2023 16:01:14 +0000 (09:01 -0700)
committerMicah Elizabeth Scott <beth@torproject.org>
Wed, 10 May 2023 14:38:28 +0000 (07:38 -0700)
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
src/feature/hs/hs_cell.c

index cadafd2c90091c948bde8d37df14226273925e22..190f0f3b5a63e9d6ad5af20f410cc7b818e91db6 100644 (file)
@@ -807,6 +807,11 @@ handle_introduce2_encrypted_cell_pow_extension(const hs_service_t *service,
 
   tor_assert(field);
 
+  if (!service->state.pow_state) {
+    log_info(LD_REND, "Unsolicited PoW solution in INTRODUCE2 request.");
+    goto end;
+  }
+
   if (trn_cell_extension_pow_parse(&pow,
                trn_extension_field_getconstarray_field(field),
                trn_extension_field_getlen_field(field)) < 0) {