Skip to content

Commit e8f0cfa

Browse files
authored
Merge pull request #1486 from Phala-Network/pherry-dcap-check
pherry: Remove provider check
2 parents 891fb32 + 284c40d commit e8f0cfa

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

standalone/pherry/src/lib.rs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ pub async fn attestation_to_report(
10251025
pccs_url: &str,
10261026
pccs_timeout_secs: u64,
10271027
) -> Result<Vec<u8>> {
1028+
info!("Processing attestation report provider={}", attestation.provider);
10281029
let report = match attestation.payload {
10291030
Some(payload) => Attestation::SgxIas {
10301031
ra_report: payload.report.as_bytes().to_vec(),
@@ -1033,24 +1034,19 @@ pub async fn attestation_to_report(
10331034
}
10341035
.encode(),
10351036
None => {
1036-
if attestation.provider.as_str() == "dcap" {
1037-
let report =
1038-
Option::<AttestationReport>::decode(&mut &attestation.encoded_report[..]);
1039-
if let Ok(Some(AttestationReport::SgxDcap {
1040-
quote,
1041-
collateral: None,
1042-
})) = report
1043-
{
1044-
if pccs_url.is_empty() {
1045-
anyhow::bail!("pccs_url is required when using dcap");
1046-
}
1047-
let timeout = Duration::from_secs(pccs_timeout_secs);
1048-
let collateral = get_collateral(pccs_url, &quote, timeout).await?;
1049-
let collateral = Some(Collateral::SgxV30(collateral));
1050-
Some(AttestationReport::SgxDcap { quote, collateral }).encode()
1051-
} else {
1052-
attestation.encoded_report
1037+
let report = Option::<AttestationReport>::decode(&mut &attestation.encoded_report[..]);
1038+
if let Ok(Some(AttestationReport::SgxDcap {
1039+
quote,
1040+
collateral: None,
1041+
})) = report
1042+
{
1043+
if pccs_url.is_empty() {
1044+
anyhow::bail!("pccs_url is required when using dcap");
10531045
}
1046+
let timeout = Duration::from_secs(pccs_timeout_secs);
1047+
let collateral = get_collateral(pccs_url, &quote, timeout).await?;
1048+
let collateral = Some(Collateral::SgxV30(collateral));
1049+
Some(AttestationReport::SgxDcap { quote, collateral }).encode()
10541050
} else {
10551051
attestation.encoded_report
10561052
}

0 commit comments

Comments
 (0)