@@ -248,36 +248,17 @@ pub struct SgxCollateralService {
248248 ) ]
249249 pub certs_service_url : Option < String > ,
250250 #[ clap(
251- long = "update_policy" ,
252- default_value = "early" ,
253- help = "Update policy (early(default) or standard)"
251+ long = "tcb_evaluation_data_number" ,
252+ help = "TCB Evaluation Data Number for TCB Info and QE Identity (default: Latest TCB Evaluation Data Number)"
254253 ) ]
255- pub update_policy : UpdatePolicy ,
254+ pub tcb_evaluation_data_number : Option < u32 > ,
256255 #[ clap(
257256 long = "expected_tcb_evaluation_data_number" ,
258257 help = "Expected TCB Evaluation Data Number for TCB Info and QE Identity"
259258 ) ]
260259 pub expected_tcb_evaluation_data_number : Option < u32 > ,
261260}
262261
263- #[ derive( Clone , Debug , PartialEq ) ]
264- pub enum UpdatePolicy {
265- Early ,
266- Standard ,
267- }
268-
269- impl FromStr for UpdatePolicy {
270- type Err = anyhow:: Error ;
271-
272- fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
273- match s. to_lowercase ( ) . as_str ( ) {
274- "early" => Ok ( Self :: Early ) ,
275- "standard" => Ok ( Self :: Standard ) ,
276- _ => Err ( anyhow ! ( "invalid update policy: {}" , s) ) ,
277- }
278- }
279- }
280-
281262impl SgxCollateralService {
282263 pub fn get_pccs_url ( & self ) -> String {
283264 self . pccs_url
@@ -298,7 +279,7 @@ impl From<SgxCollateralService> for ValidatedPCSClient {
298279 PCSClient :: new (
299280 service. get_pccs_url ( ) . as_str ( ) ,
300281 service. get_certs_service_url ( ) . as_str ( ) ,
301- service. update_policy == UpdatePolicy :: Early ,
282+ service. tcb_evaluation_data_number ,
302283 ) ,
303284 service. expected_tcb_evaluation_data_number ,
304285 )
0 commit comments