@@ -30,12 +30,11 @@ use mpz_common::Context;
30
30
use mpz_core:: Block ;
31
31
use mpz_garble_core:: Delta ;
32
32
use mpz_vm_core:: prelude:: * ;
33
- use serio:: { SinkExt , stream:: IoStreamExt } ;
33
+ use serio:: stream:: IoStreamExt ;
34
34
use tls_core:: { msgs:: enums:: ContentType , verify:: WebPkiVerifier } ;
35
- use tlsn_attestation:: { Attestation , AttestationConfig , CryptoProvider , request:: Request } ;
36
35
use tlsn_core:: {
37
36
ProvePayload ,
38
- connection:: { ConnectionInfo , ServerName , TranscriptLength } ,
37
+ connection:: { ConnectionInfo , ServerName } ,
39
38
transcript:: { TlsTranscript , TranscriptCommitment } ,
40
39
} ;
41
40
use tlsn_deap:: Deap ;
@@ -152,59 +151,6 @@ impl Verifier<state::Initialized> {
152
151
} )
153
152
}
154
153
155
- /// Runs the verifier to completion and attests to the TLS session.
156
- ///
157
- /// This is a convenience method which runs all the steps needed for
158
- /// notarization.
159
- ///
160
- /// # Arguments
161
- ///
162
- /// * `socket` - The socket to the prover.
163
- /// * `config` - The attestation configuration.
164
- #[ instrument( parent = & self . span, level = "info" , skip_all, err) ]
165
- #[ deprecated(
166
- note = "attestation functionality will be removed from this API in future releases."
167
- ) ]
168
- pub async fn notarize < S : AsyncWrite + AsyncRead + Send + Unpin + ' static > (
169
- self ,
170
- socket : S ,
171
- config : & AttestationConfig ,
172
- ) -> Result < Attestation , VerifierError > {
173
- #[ allow( deprecated) ]
174
- self . notarize_with_provider ( socket, config, & CryptoProvider :: default ( ) )
175
- . await
176
- }
177
-
178
- /// Runs the verifier to completion and attests to the TLS session.
179
- ///
180
- /// This is a convenience method which runs all the steps needed for
181
- /// notarization.
182
- ///
183
- /// # Arguments
184
- ///
185
- /// * `socket` - The socket to the prover.
186
- /// * `config` - The attestation configuration.
187
- /// * `provider` - Cryptography provider.
188
- #[ instrument( parent = & self . span, level = "info" , skip_all, err) ]
189
- #[ deprecated(
190
- note = "attestation functionality will be removed from this API in future releases."
191
- ) ]
192
- pub async fn notarize_with_provider < S : AsyncWrite + AsyncRead + Send + Unpin + ' static > (
193
- self ,
194
- socket : S ,
195
- config : & AttestationConfig ,
196
- provider : & CryptoProvider ,
197
- ) -> Result < Attestation , VerifierError > {
198
- let mut verifier = self . setup ( socket) . await ?. run ( ) . await ?;
199
-
200
- #[ allow( deprecated) ]
201
- let attestation = verifier. notarize_with_provider ( config, provider) . await ?;
202
-
203
- verifier. close ( ) . await ?;
204
-
205
- Ok ( attestation)
206
- }
207
-
208
154
/// Runs the TLS verifier to completion, verifying the TLS session.
209
155
///
210
156
/// This is a convenience method which runs all the steps needed for
@@ -472,123 +418,6 @@ impl Verifier<state::Committed> {
472
418
} )
473
419
}
474
420
475
- /// Attests to the TLS session.
476
- ///
477
- /// # Arguments
478
- ///
479
- /// * `config` - Attestation configuration.
480
- #[ instrument( parent = & self . span, level = "info" , skip_all, err) ]
481
- #[ deprecated(
482
- note = "attestation functionality will be removed from this API in future releases."
483
- ) ]
484
- pub async fn notarize (
485
- & mut self ,
486
- config : & AttestationConfig ,
487
- ) -> Result < Attestation , VerifierError > {
488
- #[ allow( deprecated) ]
489
- self . notarize_with_provider ( config, & CryptoProvider :: default ( ) )
490
- . await
491
- }
492
-
493
- /// Attests to the TLS session.
494
- ///
495
- /// # Arguments
496
- ///
497
- /// * `config` - Attestation configuration.
498
- /// * `provider` - Cryptography provider.
499
- #[ instrument( parent = & self . span, level = "info" , skip_all, err) ]
500
- #[ deprecated(
501
- note = "attestation functionality will be removed from this API in future releases."
502
- ) ]
503
- pub async fn notarize_with_provider (
504
- & mut self ,
505
- config : & AttestationConfig ,
506
- provider : & CryptoProvider ,
507
- ) -> Result < Attestation , VerifierError > {
508
- let VerifierOutput {
509
- server_name,
510
- transcript,
511
- transcript_commitments,
512
- } = self . verify ( & VerifyConfig :: default ( ) ) . await ?;
513
-
514
- if server_name. is_some ( ) {
515
- return Err ( VerifierError :: attestation (
516
- "server name can not be revealed to a verifier" ,
517
- ) ) ;
518
- } else if transcript. is_some ( ) {
519
- return Err ( VerifierError :: attestation (
520
- "transcript data can not be revealed to a verifier" ,
521
- ) ) ;
522
- }
523
-
524
- let state:: Committed {
525
- mux_fut,
526
- ctx,
527
- tls_transcript,
528
- ..
529
- } = & mut self . state ;
530
-
531
- let sent_len = tls_transcript
532
- . sent ( )
533
- . iter ( )
534
- . filter_map ( |record| {
535
- if let ContentType :: ApplicationData = record. typ {
536
- Some ( record. ciphertext . len ( ) )
537
- } else {
538
- None
539
- }
540
- } )
541
- . sum :: < usize > ( ) ;
542
-
543
- let recv_len = tls_transcript
544
- . recv ( )
545
- . iter ( )
546
- . filter_map ( |record| {
547
- if let ContentType :: ApplicationData = record. typ {
548
- Some ( record. ciphertext . len ( ) )
549
- } else {
550
- None
551
- }
552
- } )
553
- . sum :: < usize > ( ) ;
554
-
555
- let request: Request = mux_fut
556
- . poll_with ( ctx. io_mut ( ) . expect_next ( ) . map_err ( VerifierError :: from) )
557
- . await ?;
558
-
559
- let mut builder = Attestation :: builder ( config)
560
- . accept_request ( request)
561
- . map_err ( VerifierError :: attestation) ?;
562
-
563
- builder
564
- . connection_info ( ConnectionInfo {
565
- time : tls_transcript. time ( ) ,
566
- version : ( * tls_transcript. version ( ) ) ,
567
- transcript_length : TranscriptLength {
568
- sent : sent_len as u32 ,
569
- received : recv_len as u32 ,
570
- } ,
571
- } )
572
- . server_ephemeral_key ( tls_transcript. server_ephemeral_key ( ) . clone ( ) )
573
- . transcript_commitments ( transcript_commitments) ;
574
-
575
- let attestation = builder
576
- . build ( provider)
577
- . map_err ( VerifierError :: attestation) ?;
578
-
579
- mux_fut
580
- . poll_with (
581
- ctx. io_mut ( )
582
- . send ( attestation. clone ( ) )
583
- . map_err ( VerifierError :: from) ,
584
- )
585
- . await ?;
586
-
587
- info ! ( "Sent attestation" ) ;
588
-
589
- Ok ( attestation)
590
- }
591
-
592
421
/// Closes the connection with the prover.
593
422
#[ instrument( parent = & self . span, level = "info" , skip_all, err) ]
594
423
pub async fn close ( self ) -> Result < ( ) , VerifierError > {
0 commit comments