Skip to content

Commit 82b9bf5

Browse files
committed
Tidy
1 parent 28e7a26 commit 82b9bf5

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/attestation/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl Display for AttestationType {
115115
}
116116

117117
/// Can generate a local attestation based on attestation type
118-
#[derive(Clone)]
118+
#[derive(Debug, Clone)]
119119
pub struct AttestationGenerator {
120120
pub attestation_type: AttestationType,
121121
dummy_dcap_url: Option<String>,

src/attested_tls.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ impl AttestedTlsServer {
135135
pub async fn handle_connection(
136136
&self,
137137
inbound: TcpStream,
138-
// acceptor: TlsAcceptor,
139-
// cert_chain: Vec<CertificateDer<'static>>,
140-
// attestation_generator: AttestationGenerator,
141-
// attestation_verifier: AttestationVerifier,
142138
) -> Result<
143139
(
144140
tokio_rustls::server::TlsStream<tokio::net::TcpStream>,
@@ -224,10 +220,11 @@ pub struct AttestedTlsClient {
224220
}
225221

226222
impl std::fmt::Debug for AttestedTlsClient {
227-
// TODO add other fields
228223
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
229224
f.debug_struct("AttestedTlsClient")
230225
.field("attestation_verifier", &self.attestation_verifier)
226+
.field("attestation_generator", &self.attestation_generator)
227+
.field("cert_chain", &self.cert_chain)
231228
.finish()
232229
}
233230
}
@@ -297,7 +294,7 @@ impl AttestedTlsClient {
297294
})
298295
}
299296

300-
/// Connect to the attested-tls-server, do TLS handshake and remote attestation
297+
/// Connect to an attested-tls-server, do TLS handshake and attestation exchange
301298
pub async fn connect(
302299
&self,
303300
target: String,
@@ -376,7 +373,7 @@ impl AttestedTlsClient {
376373
}
377374
}
378375

379-
/// Just get the attested remote certificate, with no client authentication
376+
/// A client which just gets the attested remote certificate, with no client authentication
380377
pub async fn get_tls_cert(
381378
server_name: String,
382379
attestation_verifier: AttestationVerifier,
@@ -405,6 +402,7 @@ pub async fn get_tls_cert(
405402
get_tls_cert_with_config(server_name, attestation_verifier, client_config.into()).await
406403
}
407404

405+
// TODO this could use AttestedTlsClient to avoid repeating code
408406
pub(crate) async fn get_tls_cert_with_config(
409407
server_name: String,
410408
attestation_verifier: AttestationVerifier,
@@ -497,10 +495,6 @@ pub enum AttestedTlsError {
497495
IntConversion(#[from] TryFromIntError),
498496
#[error("Bad host name: {0}")]
499497
BadDnsName(#[from] tokio_rustls::rustls::pki_types::InvalidDnsNameError),
500-
#[error("HTTP: {0}")]
501-
Hyper(#[from] hyper::Error),
502-
#[error("JSON: {0}")]
503-
Json(#[from] serde_json::Error),
504498
#[error("Serialization: {0}")]
505499
Serialization(#[from] parity_scale_codec::Error),
506500
#[error("Protocol negotiation failed - remote peer does not support this protocol")]

0 commit comments

Comments
 (0)