@@ -457,7 +457,6 @@ fn pad64(data: &[u8]) -> Option<[u8; 64]> {
457457 Some ( padded)
458458}
459459
460-
461460impl RpcCall < AppState > for InternalRpcHandler {
462461 type PrpcService = DstackGuestServer < Self > ;
463462
@@ -657,15 +656,18 @@ impl RpcCall<AppState> for ExternalRpcHandler {
657656#[ cfg( test) ]
658657mod tests {
659658 use super :: * ;
660- use crate :: { backend:: PlatformBackend , config:: { AppComposeWrapper , Config } } ;
659+ use crate :: {
660+ backend:: PlatformBackend ,
661+ config:: { AppComposeWrapper , Config } ,
662+ } ;
661663 use dstack_guest_agent_rpc:: { GetAttestationForAppKeyRequest , SignRequest } ;
662- use ra_tls:: attestation:: VersionedAttestation ;
663664 use dstack_types:: { AppCompose , AppKeys , KeyProvider } ;
664665 use ed25519_dalek:: ed25519:: signature:: hazmat:: PrehashVerifier ;
665666 use ed25519_dalek:: {
666667 Signature as Ed25519Signature , Verifier , VerifyingKey as Ed25519VerifyingKey ,
667668 } ;
668669 use k256:: ecdsa:: { Signature as K256Signature , VerifyingKey } ;
670+ use ra_tls:: attestation:: VersionedAttestation ;
669671 use sha2:: Sha256 ;
670672 use std:: collections:: HashSet ;
671673 use std:: convert:: TryFrom ;
@@ -812,7 +814,8 @@ pNs85uhOZE8z2jr8Pg==
812814
813815 fn certificate_attestation ( & self , pubkey : & [ u8 ] ) -> Result < VersionedAttestation > {
814816 let mut attestation = self . attestation . clone ( ) ;
815- let report_data = ra_tls:: attestation:: QuoteContentType :: RaTlsCert . to_report_data ( pubkey) ;
817+ let report_data =
818+ ra_tls:: attestation:: QuoteContentType :: RaTlsCert . to_report_data ( pubkey) ;
816819 attestation. set_report_data ( report_data) ;
817820 Ok ( attestation)
818821 }
@@ -822,15 +825,18 @@ pNs85uhOZE8z2jr8Pg==
822825 report_data : [ u8 ; 64 ] ,
823826 vm_config : & str ,
824827 ) -> Result < GetQuoteResponse > {
825- let ra_tls:: attestation:: VersionedAttestation :: V0 { attestation } = self . attestation . clone ( ) ;
828+ let ra_tls:: attestation:: VersionedAttestation :: V0 { attestation } =
829+ self . attestation . clone ( ) ;
826830 let mut attestation = attestation;
827831 let Some ( quote) = attestation. tdx_quote_mut ( ) else {
828832 return Err ( anyhow:: anyhow!( "Quote not found" ) ) ;
829833 } ;
830- quote. quote [ ra_tls:: attestation:: TDX_QUOTE_REPORT_DATA_RANGE ] . copy_from_slice ( & report_data) ;
834+ quote. quote [ ra_tls:: attestation:: TDX_QUOTE_REPORT_DATA_RANGE ]
835+ . copy_from_slice ( & report_data) ;
831836 Ok ( GetQuoteResponse {
832837 quote : quote. quote . to_vec ( ) ,
833- event_log : serde_json:: to_string ( & quote. event_log ) . context ( "Failed to serialize event log" ) ?,
838+ event_log : serde_json:: to_string ( & quote. event_log )
839+ . context ( "Failed to serialize event log" ) ?,
834840 report_data : report_data. to_vec ( ) ,
835841 vm_config : vm_config. to_string ( ) ,
836842 } )
@@ -854,7 +860,10 @@ pNs85uhOZE8z2jr8Pg==
854860 cert_client : dummy_cert_client,
855861 demo_cert : RwLock :: new ( String :: new ( ) ) ,
856862 platform : Arc :: new ( TestSimulatorPlatform {
857- attestation : VersionedAttestation :: from_scale ( & std:: fs:: read ( temp_attestation_file. path ( ) ) . unwrap ( ) ) . unwrap ( ) ,
863+ attestation : VersionedAttestation :: from_scale (
864+ & std:: fs:: read ( temp_attestation_file. path ( ) ) . unwrap ( ) ,
865+ )
866+ . unwrap ( ) ,
858867 } ) ,
859868 } ;
860869
0 commit comments