Skip to content

Commit

Permalink
hotfix skip-ra with dcap
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Aug 14, 2023
1 parent 2c0cab6 commit 944df03
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions enclave-runtime/src/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,19 @@ pub fn generate_dcap_ra_extrinsic_internal(
) -> EnclaveResult<OpaqueExtrinsic> {
let attestation_handler = GLOBAL_ATTESTATION_HANDLER_COMPONENT.get()?;

let (_priv_key_der, _cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert(
quoting_enclave_target_info,
quote_size,
skip_ra,
)?;

if !skip_ra {
let (_priv_key_der, _cert_der, dcap_quote) = attestation_handler.generate_dcap_ra_cert(
quoting_enclave_target_info,
quote_size,
skip_ra,
)?;

generate_dcap_ra_extrinsic_from_quote_internal(url, &dcap_quote)
} else {
generate_dcap_skip_ra_extrinsic_from_quote_internal(url, &dcap_quote)
generate_dcap_skip_ra_extrinsic_from_mr_enclave(
url,
&attestation_handler.get_mrenclave()?.encode(),
)
}
}

Expand Down Expand Up @@ -304,7 +307,7 @@ pub fn generate_dcap_ra_extrinsic_from_quote_internal(
create_extrinsics(call)
}

pub fn generate_dcap_skip_ra_extrinsic_from_quote_internal(
pub fn generate_dcap_skip_ra_extrinsic_from_mr_enclave(
url: String,
quote: &[u8],
) -> EnclaveResult<OpaqueExtrinsic> {
Expand Down

0 comments on commit 944df03

Please sign in to comment.