Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add many unit tests for nearly all attestation types #162

Merged
merged 13 commits into from
May 15, 2020
Prev Previous commit
Next Next commit
Remainder of TPM tests (except chain validation).
  • Loading branch information
aseigler committed May 11, 2020
commit 19c626e01357eea16765bb74418cc8da850cc4b6
4 changes: 2 additions & 2 deletions Src/Fido2/AttestationFormat/Tpm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ public override void Verify()
certInfo = new CertInfo(attStmt["certInfo"].GetByteString());
}

if (null == certInfo || null == certInfo.ExtraData || 0 == certInfo.ExtraData.Length)
if (null == certInfo)
throw new Fido2VerificationException("CertInfo invalid parsing TPM format attStmt");

// Verify that magic is set to TPM_GENERATED_VALUE and type is set to TPM_ST_ATTEST_CERTIFY
Expand Down Expand Up @@ -580,7 +580,7 @@ public override void Verify()
// OID is 2.23.133.8.3
var EKU = EKUFromAttnCertExts(aikCert.Extensions, "2.23.133.8.3");
if (!EKU)
throw new Fido2VerificationException("Invalid EKU on AIK certificate");
throw new Fido2VerificationException("aikCert EKU missing tcg-kp-AIKCertificate OID");

// The Basic Constraints extension MUST have the CA component set to false.
if (IsAttnCertCACert(aikCert.Extensions))
Expand Down