Skip to content

Commit

Permalink
fixes for testing and ci
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Matthews <[email protected]>
  • Loading branch information
Isaac-Matthews committed Sep 19, 2023
1 parent 3201cd3 commit c9d5cf6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
14 changes: 7 additions & 7 deletions keylime-agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ async fn main() -> Result<()> {
let (attest, signature) = if config.agent.enable_iak_idevid {
let qualifying_data = config.agent.uuid.as_bytes();
let (attest, signature) = ctx.certify_credential_with_iak(
Data::try_from(qualifying_data).unwrap(),
Data::try_from(qualifying_data).unwrap(), //#[allow_ci]
ak_handle,
iak.as_ref().unwrap().handle,
iak.as_ref().unwrap().handle, //#[allow_ci]
)?;
info!("AK certified with IAK.");

Expand All @@ -449,7 +449,7 @@ async fn main() -> Result<()> {
// let (hashed_attest, _) = ctx.inner.hash(max_b, HashingAlgorithm::Sha256, Hierarchy::Endorsement,)?;
// println!("{:?}", hashed_attest);
// println!("{:?}", signature);
// println!("{:?}", ctx.inner.verify_signature(iak.as_ref().unwrap().handle, hashed_attest, signature.clone())?);
// println!("{:?}", ctx.inner.verify_signature(iak.as_ref().unwrap().handle, hashed_attest, signature.clone())?); //#[allow_ci]
(Some(attest), Some(signature))
} else {
(None, None)
Expand Down Expand Up @@ -577,15 +577,15 @@ async fn main() -> Result<()> {
ek_result.ek_cert,
&PublicBuffer::try_from(ak.public)?.marshall()?,
Some(
&PublicBuffer::try_from(iak.unwrap().public.clone())?
&PublicBuffer::try_from(iak.unwrap().public.clone())? //#[allow_ci]
.marshall()?,
),
Some(
&PublicBuffer::try_from(idevid.unwrap().public.clone())?
&PublicBuffer::try_from(idevid.unwrap().public.clone())? //#[allow_ci]
.marshall()?,
),
Some(attest.unwrap().marshall()?),
Some(signature.unwrap().marshall()?),
Some(attest.unwrap().marshall()?), //#[allow_ci]
Some(signature.unwrap().marshall()?), //#[allow_ci]
mtls_cert,
config.agent.contact_ip.as_ref(),
config.agent.contact_port,
Expand Down
12 changes: 12 additions & 0 deletions keylime-agent/src/registrar_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ mod tests {
&mock_data,
Some(mock_data.to_vec()),
&mock_data,
None,
None,
None,
None,
Some(&cert),
"",
0,
Expand Down Expand Up @@ -265,6 +269,10 @@ mod tests {
&mock_data,
None,
&mock_data,
None,
None,
None,
None,
Some(&cert),
"",
0,
Expand Down Expand Up @@ -303,6 +311,10 @@ mod tests {
&mock_data,
Some(mock_data.to_vec()),
&mock_data,
None,
None,
None,
None,
Some(&cert),
"",
0,
Expand Down
12 changes: 6 additions & 6 deletions keylime/src/tpm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ impl Context {
.execute_with_nullauth_session(|ctx| {
ctx.create_primary(
Hierarchy::Endorsement,
key_pub.unwrap().public,
key_pub.unwrap().public, //#[allow_ci]
None,
None,
None,
Some(pcr_selection_list),
)
})
.unwrap();
.unwrap(); //#[allow_ci]

Ok(IDevIDResult {
public: primary_key.out_public,
Expand Down Expand Up @@ -471,7 +471,7 @@ impl Context {
};

Ok(IDevIDPublic {
public: key_builder.build().unwrap(),
public: key_builder.build().unwrap(), //#[allow_ci]
})
}

Expand Down Expand Up @@ -506,14 +506,14 @@ impl Context {
.execute_with_nullauth_session(|ctx| {
ctx.create_primary(
Hierarchy::Endorsement,
key_pub.unwrap().public,
key_pub.unwrap().public, //#[allow_ci]
None,
None,
None,
Some(pcr_selection_list),
)
})
.unwrap();
.unwrap(); //#[allow_ci]

Ok(IAKResult {
public: primary_key.out_public,
Expand Down Expand Up @@ -640,7 +640,7 @@ impl Context {
};

Ok(IAKPublic {
public: key_builder.build().unwrap(),
public: key_builder.build().unwrap(), //#[allow_ci]
})
}

Expand Down

0 comments on commit c9d5cf6

Please sign in to comment.