File tree Expand file tree Collapse file tree 4 files changed +15
-15
lines changed
qos_core/src/protocol/services Expand file tree Collapse file tree 4 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -873,7 +873,7 @@ mod test {
873
873
& manifest_envelope,
874
874
& att_doc
875
875
) ,
876
- Err ( ProtocolError :: QosAttestError ( "DifferentPcr0" . to_string( ) ) )
876
+ Err ( ProtocolError :: QosAttestError ( "DifferentPcr0( \" 8080808080808080808080808080808080808080808080808080808080808080 \" , \" 0404040404040404040404040404040404040404040404040404040404040404 \" ) " . to_string( ) ) )
877
877
) ;
878
878
}
879
879
Original file line number Diff line number Diff line change @@ -73,8 +73,6 @@ fn boot() -> String {
73
73
let memory_mib = std:: env:: var ( "MEMORY_MIB" ) . unwrap_or ( "1024" . to_string ( ) ) ;
74
74
let cpu_count = std:: env:: var ( "CPU_COUNT" ) . unwrap_or ( "2" . to_string ( ) ) ;
75
75
let debug_mode = std:: env:: var ( "DEBUG" ) . unwrap_or ( "false" . to_string ( ) ) ;
76
- let attach_console =
77
- std:: env:: var ( "ATTACH_CONSOLE" ) . unwrap_or ( "false" . to_string ( ) ) ;
78
76
let enclave_name =
79
77
std:: env:: var ( "ENCLAVE_NAME" ) . unwrap_or ( "nitro" . to_string ( ) ) ;
80
78
let run_args = RunEnclavesArgs {
@@ -83,7 +81,7 @@ fn boot() -> String {
83
81
memory_mib : memory_mib. parse :: < u64 > ( ) . unwrap ( ) ,
84
82
cpu_ids : None ,
85
83
debug_mode : debug_mode. parse :: < bool > ( ) . unwrap ( ) ,
86
- attach_console : attach_console . parse :: < bool > ( ) . unwrap ( ) , // TODO: I think we don't want this variable, remove once debug is done
84
+ attach_console : false ,
87
85
cpu_count : Some ( cpu_count. parse :: < u32 > ( ) . unwrap ( ) ) ,
88
86
enclave_name : Some ( enclave_name. clone ( ) ) ,
89
87
} ;
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ pub enum AttestError {
55
55
/// The attestation doc does not contain a pcr0.
56
56
MissingPcr0 ,
57
57
/// The pcr3 in the attestation doc does not match.
58
- DifferentPcr0 ,
58
+ DifferentPcr0 ( String , String ) , // TODO: DEBUG: ales - remove later
59
59
/// The attestation doc does not have a pcr1.
60
60
MissingPcr1 ,
61
61
/// The attestation doc has a different pcr1.
Original file line number Diff line number Diff line change @@ -87,15 +87,17 @@ pub fn verify_attestation_doc_against_user_input(
87
87
return Err ( AttestError :: UnexpectedAttestationDocNonce ) ;
88
88
}
89
89
90
- if pcr0
91
- != attestation_doc
92
- . pcrs
93
- . get ( & 0 )
94
- . ok_or ( AttestError :: MissingPcr0 ) ?
95
- . clone ( )
96
- . into_vec ( )
97
- {
98
- return Err ( AttestError :: DifferentPcr0 ) ;
90
+ let doc_pcr0 = attestation_doc
91
+ . pcrs
92
+ . get ( & 0 )
93
+ . ok_or ( AttestError :: MissingPcr0 ) ?
94
+ . clone ( )
95
+ . into_vec ( ) ;
96
+ if pcr0 != doc_pcr0 {
97
+ return Err ( AttestError :: DifferentPcr0 (
98
+ qos_hex:: encode ( pcr0) ,
99
+ qos_hex:: encode ( & doc_pcr0) ,
100
+ ) ) ;
99
101
}
100
102
101
103
// pcr1 matches
@@ -707,7 +709,7 @@ mod test {
707
709
. unwrap_err ( ) ;
708
710
709
711
match err {
710
- AttestError :: DifferentPcr0 => ( ) ,
712
+ AttestError :: DifferentPcr0 ( _ , _ ) => ( ) ,
711
713
_ => panic ! ( ) ,
712
714
}
713
715
}
You can’t perform that action at this time.
0 commit comments