mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
hs-v3: Implement HS_DESC UPLOADED event
Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
committed by
Nick Mathewson
parent
c7050eaa16
commit
427b247c8d
+1
-1
@@ -3306,7 +3306,7 @@ handle_response_upload_hsdesc(dir_connection_t *conn,
|
||||
case 200:
|
||||
log_info(LD_REND, "Uploading hidden service descriptor: "
|
||||
"finished with status 200 (%s)", escaped(reason));
|
||||
/* XXX: Trigger control event. */
|
||||
hs_control_desc_event_uploaded(conn->hs_ident, conn->identity_digest);
|
||||
break;
|
||||
case 400:
|
||||
log_fn(LOG_PROTOCOL_WARN, LD_REND,
|
||||
|
||||
@@ -154,3 +154,21 @@ hs_control_desc_event_upload(const char *onion_address,
|
||||
DIGEST256_LEN));
|
||||
}
|
||||
|
||||
/* Send on the control port the "HS_DESC UPLOADED [...]" event.
|
||||
*
|
||||
* Using the directory connection identifier and the HSDir identity digest.
|
||||
* None can be NULL. */
|
||||
void
|
||||
hs_control_desc_event_uploaded(const hs_ident_dir_conn_t *ident,
|
||||
const char *hsdir_id_digest)
|
||||
{
|
||||
char onion_address[HS_SERVICE_ADDR_LEN_BASE32 + 1];
|
||||
|
||||
tor_assert(ident);
|
||||
tor_assert(hsdir_id_digest);
|
||||
|
||||
hs_build_address(&ident->identity_pk, HS_VERSION_THREE, onion_address);
|
||||
|
||||
control_event_hs_descriptor_uploaded(hsdir_id_digest, onion_address);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,5 +35,9 @@ void hs_control_desc_event_upload(const char *onion_address,
|
||||
const ed25519_public_key_t *blinded_pk,
|
||||
const uint8_t *hsdir_index);
|
||||
|
||||
/* Event "HS_DESC UPLOADED [...]" */
|
||||
void hs_control_desc_event_uploaded(const hs_ident_dir_conn_t *ident,
|
||||
const char *hsdir_id_digest);
|
||||
|
||||
#endif /* !defined(TOR_HS_CONTROL_H) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user