diff --git a/attestation-service/attestation-service/src/bin/grpc/mod.rs b/attestation-service/attestation-service/src/bin/grpc/mod.rs index 829735db41..f302a3013d 100644 --- a/attestation-service/attestation-service/src/bin/grpc/mod.rs +++ b/attestation-service/attestation-service/src/bin/grpc/mod.rs @@ -216,7 +216,7 @@ impl AttestationService for Arc> { .read() .await .attestation_service - .generate_challenge(tee, Some(request.tee_params.clone().into_bytes())) + .generate_supplemental_challenge(tee, Some(request.tee_params.clone().into_bytes())) .await .map_err(|e| Status::aborted(format!("Challenge: {e:?}")))?; diff --git a/attestation-service/attestation-service/src/bin/restful/mod.rs b/attestation-service/attestation-service/src/bin/restful/mod.rs index 76c33f5ea0..23dfccd2cd 100644 --- a/attestation-service/attestation-service/src/bin/restful/mod.rs +++ b/attestation-service/attestation-service/src/bin/restful/mod.rs @@ -189,7 +189,7 @@ pub async fn get_challenge( let challenge = cocoas .read() .await - .generate_challenge(tee, Some(request.tee_params.clone().into_bytes())) + .generate_supplemental_challenge(tee, Some(request.tee_params.clone().into_bytes())) .await .context("generate challenge")?; Ok(HttpResponse::Ok().body(challenge)) diff --git a/attestation-service/attestation-service/src/lib.rs b/attestation-service/attestation-service/src/lib.rs index 73d5a719f8..9f08d01206 100644 --- a/attestation-service/attestation-service/src/lib.rs +++ b/attestation-service/attestation-service/src/lib.rs @@ -259,13 +259,13 @@ impl AttestationService { self.rvps.verify_and_extract(message).await } - pub async fn generate_challenge( + pub async fn generate_supplemental_challenge( &self, tee: Tee, tee_parameters: Option>, ) -> Result { let verifier = verifier::to_verifier(&tee)?; - verifier.generate_challenge(tee_parameters).await + verifier.generate_supplemental_challenge(tee_parameters).await } } diff --git a/attestation-service/verifier/src/lib.rs b/attestation-service/verifier/src/lib.rs index cb145b7a5e..369b60534c 100644 --- a/attestation-service/verifier/src/lib.rs +++ b/attestation-service/verifier/src/lib.rs @@ -167,7 +167,7 @@ pub trait Verifier { expected_init_data_hash: &InitDataHash, ) -> Result; - async fn generate_challenge( + async fn generate_supplemental_challenge( &self, _tee_parameters: Option>, ) -> Result { diff --git a/attestation-service/verifier/src/se/mod.rs b/attestation-service/verifier/src/se/mod.rs index 89c9e8ec0c..bd708203a2 100644 --- a/attestation-service/verifier/src/se/mod.rs +++ b/attestation-service/verifier/src/se/mod.rs @@ -27,7 +27,7 @@ impl Verifier for SeVerifier { verify_evidence(evidence, expected_report_data, expected_init_data_hash).await } - async fn generate_challenge( + async fn generate_supplemental_challenge( &self, _tee_parameters: Option>, ) -> Result { diff --git a/kbs/src/api/src/attestation/coco/builtin.rs b/kbs/src/api/src/attestation/coco/builtin.rs index 400e5a79ea..8a2cd3a0c3 100644 --- a/kbs/src/api/src/attestation/coco/builtin.rs +++ b/kbs/src/api/src/attestation/coco/builtin.rs @@ -46,7 +46,7 @@ impl Attest for BuiltInCoCoAs { .await } - async fn generate_challenge( + async fn generate_supplemental_challenge( &self, tee: Tee, tee_parameters: Option>, @@ -54,7 +54,7 @@ impl Attest for BuiltInCoCoAs { self.inner .read() .await - .generate_challenge(tee, tee_parameters) + .generate_supplemental_challenge(tee, tee_parameters) .await } } diff --git a/kbs/src/api/src/attestation/coco/grpc.rs b/kbs/src/api/src/attestation/coco/grpc.rs index ed60face30..dd03338564 100644 --- a/kbs/src/api/src/attestation/coco/grpc.rs +++ b/kbs/src/api/src/attestation/coco/grpc.rs @@ -127,7 +127,7 @@ impl Attest for GrpcClientPool { Ok(token) } - async fn generate_challenge( + async fn generate_supplemental_challenge( &self, tee: Tee, tee_parameters: Option>, diff --git a/kbs/src/api/src/attestation/intel_trust_authority/mod.rs b/kbs/src/api/src/attestation/intel_trust_authority/mod.rs index 6d282b9b85..2de4e1bc7d 100644 --- a/kbs/src/api/src/attestation/intel_trust_authority/mod.rs +++ b/kbs/src/api/src/attestation/intel_trust_authority/mod.rs @@ -123,7 +123,7 @@ impl Attest for IntelTrustAuthority { Ok(resp_data.token.clone()) } - async fn generate_challenge( + async fn generate_supplemental_challenge( &self, _tee: Tee, _tee_parameters: Option>, diff --git a/kbs/src/api/src/attestation/mod.rs b/kbs/src/api/src/attestation/mod.rs index 6a592ad2db..090bb80733 100644 --- a/kbs/src/api/src/attestation/mod.rs +++ b/kbs/src/api/src/attestation/mod.rs @@ -34,7 +34,7 @@ pub trait Attest: Send + Sync { async fn verify(&self, tee: Tee, nonce: &str, attestation: &str) -> Result; /// generate the challenge payload to pass to attester based on Tee and nonce - async fn generate_challenge(&self, tee: Tee, tee_parameters: Option>) + async fn generate_supplemental_challenge(&self, tee: Tee, tee_parameters: Option>) -> Result; } @@ -94,7 +94,7 @@ impl AttestationService { } } - pub async fn generate_challenge( + pub async fn generate_supplemental_challenge( &self, tee: Tee, tee_parameters: Option>, @@ -102,15 +102,15 @@ impl AttestationService { match self { #[cfg(feature = "coco-as-grpc")] AttestationService::CoCoASgRPC(inner) => { - inner.generate_challenge(tee, tee_parameters).await + inner.generate_supplemental_challenge(tee, tee_parameters).await } #[cfg(any(feature = "coco-as-builtin", feature = "coco-as-builtin-no-verifier"))] AttestationService::CoCoASBuiltIn(inner) => { - inner.generate_challenge(tee, tee_parameters).await + inner.generate_supplemental_challenge(tee, tee_parameters).await } #[cfg(feature = "intel-trust-authority-as")] AttestationService::IntelTA(inner) => { - inner.generate_challenge(tee, tee_parameters).await + inner.generate_supplemental_challenge(tee, tee_parameters).await } } } diff --git a/kbs/src/api/src/http/attest.rs b/kbs/src/api/src/http/attest.rs index c8caa8506a..62696f0185 100644 --- a/kbs/src/api/src/http/attest.rs +++ b/kbs/src/api/src/http/attest.rs @@ -24,7 +24,7 @@ pub(crate) async fn auth( debug!("Auth Request: {:?}", &request); let extra_params = attestation_service - .generate_challenge(request.tee, Some(request.extra_params.clone().into_bytes())) + .generate_supplemental_challenge(request.tee, Some(request.extra_params.clone().into_bytes())) .await .unwrap();