Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Conversation

@divegeek
Copy link
Collaborator

@divegeek divegeek commented Mar 8, 2023

Also, tighten up the required certificate chain structure, to specify that the leaf certificate must be an attestation certificate, and that any attestation certificates after the leaf must be for ATTEST_KEYs.

Shawn Willden added 2 commits March 8, 2023 08:58
Also, tighten up the required certificate chain structure, to specify that the
leaf certificate must be an attestation certificate, and that any attestation
certificates after the leaf must be for ATTEST_KEYs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to "cert_chain_without_attest_key_certs.pem"

}

// Leaf certificate should contain the attestation record we're looking for.
final ParsedAttestationRecord retval = extractParsedAttestationRecord(certs.get(0));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change variable from "retval" to "attestationRecord"

// aren't for ATTEST_KEYs, throw.
boolean foundNonAttestationCert = false;
for (X509Certificate cert : certs.stream().skip(1).collect(Collectors.toList())) {
final ParsedAttestationRecord record = extractParsedAttestationRecord(cert);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"record" to "intermediateAttestationRecord"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include in the name what is actually wrong with this chain (does it try to assert an attestation after a non attest key cert? is the cert missing the attestation at the end?) and then add chains for the other failure conditions.

// we find any attestations after the first non-attestation, or if we find any attestations that
// aren't for ATTEST_KEYs, throw.
boolean foundNonAttestationCert = false;
for (X509Certificate cert : certs.stream().skip(1).collect(Collectors.toList())) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not certs.listIterator(1)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants