Merge branch 'relayids' into 'main'

tor-hsclient: Make RendPtIdentityForError use RelayIds

See merge request tpo/core/arti!1335
This commit is contained in:
Nick Mathewson 2023-06-28 16:26:22 +00:00
commit 0b2c8f5e92
1 changed files with 7 additions and 10 deletions

View File

@ -12,19 +12,16 @@ use safelog::{Redacted, Sensitive};
use tor_cell::relaycell::hs::IntroduceAckStatus;
use tor_error::define_asref_dyn_std_error;
use tor_error::{internal, Bug, ErrorKind, ErrorReport as _, HasKind, HasRetryTime, RetryTime};
use tor_linkspec::RelayIds;
use tor_llcrypto::pk::ed25519::Ed25519Identity;
use tor_llcrypto::pk::rsa::RsaIdentity;
use tor_netdir::Relay;
/// Identity of a rendezvous point, for use in error reports
//
// TODO HS this should be `Redacted<RelayIds>`, as per
// <https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1228#note_2910283>
pub(crate) type RendPtIdentityForError = Redacted<RsaIdentity>;
pub(crate) type RendPtIdentityForError = Redacted<RelayIds>;
/// Given a `Relay` for a rendezvous pt, provides its identify for use in error reports
pub(crate) fn rend_pt_identity_for_error(relay: &Relay<'_>) -> RendPtIdentityForError {
(*relay.rsa_id()).into()
RelayIds::from_relay_ids(relay).into()
}
/// Index of an introduction point in the descriptor
@ -169,7 +166,7 @@ pub enum FailedAttemptError {
RendezvousEstablishTimeout {
/// Which relay did we choose for rendezvous point
// TODO #813 this should be Redacted<RelayDescription> or something
rend_pt: Redacted<RsaIdentity>,
rend_pt: RendPtIdentityForError,
},
/// Failed to establish rendezvous point
@ -181,7 +178,7 @@ pub enum FailedAttemptError {
/// Which relay did we choose for rendezvous point
// TODO #813 this should be Redacted<RelayDescription> or something
rend_pt: Redacted<RsaIdentity>,
rend_pt: RendPtIdentityForError,
},
/// Failed to obtain circuit to introduction point
@ -237,7 +234,7 @@ pub enum FailedAttemptError {
/// Which relay did we choose for rendezvous point
// TODO #813 this should be Redacted<RelayDescription> or something
rend_pt: Redacted<RsaIdentity>,
rend_pt: RendPtIdentityForError,
},
/// Error on rendezvous circuit when expecting rendezvous completion
@ -252,7 +249,7 @@ pub enum FailedAttemptError {
/// Which relay did we choose for rendezvous point
// TODO #813 this should be Redacted<RelayDescription> or something
rend_pt: Redacted<RsaIdentity>,
rend_pt: RendPtIdentityForError,
},
/// Internal error