Skip to content

Commit b3bdee7

Browse files
committed
remove remaining notarize methods
1 parent 1f1c474 commit b3bdee7

File tree

1 file changed

+0
-117
lines changed

1 file changed

+0
-117
lines changed

crates/tlsn/src/verifier.rs

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -419,123 +419,6 @@ impl Verifier<state::Committed> {
419419
})
420420
}
421421

422-
/// Attests to the TLS session.
423-
///
424-
/// # Arguments
425-
///
426-
/// * `config` - Attestation configuration.
427-
#[instrument(parent = &self.span, level = "info", skip_all, err)]
428-
#[deprecated(
429-
note = "attestation functionality will be removed from this API in future releases."
430-
)]
431-
pub async fn notarize(
432-
&mut self,
433-
config: &AttestationConfig,
434-
) -> Result<Attestation, VerifierError> {
435-
#[allow(deprecated)]
436-
self.notarize_with_provider(config, &CryptoProvider::default())
437-
.await
438-
}
439-
440-
/// Attests to the TLS session.
441-
///
442-
/// # Arguments
443-
///
444-
/// * `config` - Attestation configuration.
445-
/// * `provider` - Cryptography provider.
446-
#[instrument(parent = &self.span, level = "info", skip_all, err)]
447-
#[deprecated(
448-
note = "attestation functionality will be removed from this API in future releases."
449-
)]
450-
pub async fn notarize_with_provider(
451-
&mut self,
452-
config: &AttestationConfig,
453-
provider: &CryptoProvider,
454-
) -> Result<Attestation, VerifierError> {
455-
let VerifierOutput {
456-
server_name,
457-
transcript,
458-
transcript_commitments,
459-
} = self.verify(&VerifyConfig::default()).await?;
460-
461-
if server_name.is_some() {
462-
return Err(VerifierError::attestation(
463-
"server name can not be revealed to a verifier",
464-
));
465-
} else if transcript.is_some() {
466-
return Err(VerifierError::attestation(
467-
"transcript data can not be revealed to a verifier",
468-
));
469-
}
470-
471-
let state::Committed {
472-
mux_fut,
473-
ctx,
474-
tls_transcript,
475-
..
476-
} = &mut self.state;
477-
478-
let sent_len = tls_transcript
479-
.sent()
480-
.iter()
481-
.filter_map(|record| {
482-
if let ContentType::ApplicationData = record.typ {
483-
Some(record.ciphertext.len())
484-
} else {
485-
None
486-
}
487-
})
488-
.sum::<usize>();
489-
490-
let recv_len = tls_transcript
491-
.recv()
492-
.iter()
493-
.filter_map(|record| {
494-
if let ContentType::ApplicationData = record.typ {
495-
Some(record.ciphertext.len())
496-
} else {
497-
None
498-
}
499-
})
500-
.sum::<usize>();
501-
502-
let request: Request = mux_fut
503-
.poll_with(ctx.io_mut().expect_next().map_err(VerifierError::from))
504-
.await?;
505-
506-
let mut builder = Attestation::builder(config)
507-
.accept_request(request)
508-
.map_err(VerifierError::attestation)?;
509-
510-
builder
511-
.connection_info(ConnectionInfo {
512-
time: tls_transcript.time(),
513-
version: (*tls_transcript.version()),
514-
transcript_length: TranscriptLength {
515-
sent: sent_len as u32,
516-
received: recv_len as u32,
517-
},
518-
})
519-
.server_ephemeral_key(tls_transcript.server_ephemeral_key().clone())
520-
.transcript_commitments(transcript_commitments);
521-
522-
let attestation = builder
523-
.build(provider)
524-
.map_err(VerifierError::attestation)?;
525-
526-
mux_fut
527-
.poll_with(
528-
ctx.io_mut()
529-
.send(attestation.clone())
530-
.map_err(VerifierError::from),
531-
)
532-
.await?;
533-
534-
info!("Sent attestation");
535-
536-
Ok(attestation)
537-
}
538-
539422
/// Closes the connection with the prover.
540423
#[instrument(parent = &self.span, level = "info", skip_all, err)]
541424
pub async fn close(self) -> Result<(), VerifierError> {

0 commit comments

Comments
 (0)