hs_pow: fix assert in services that receive unsolicited proof of work

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
This commit is contained in:
Micah Elizabeth Scott 2023-03-14 09:01:14 -07:00
parent 3129910b11
commit 037dea2252

View 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) {