-
Couldn't load subscription status.
- Fork 71
Correct handling of ATTEST_KEYs. #33
base: master
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"record" to "intermediateAttestationRecord"
There was a problem hiding this comment.
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())) { |
There was a problem hiding this comment.
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)?
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.