Skip to content

Commit 8474644

Browse files
committed
Add generated TPM attestation test cases
1 parent e573f14 commit 8474644

File tree

8 files changed

+1415
-77
lines changed

8 files changed

+1415
-77
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Changes:
55
* Log messages on attestation certificate path validation failure now include
66
the attestation object.
77

8+
New features:
9+
10+
* Added support for the `"tpm"` attestation statement format.
11+
* Added support for ES384 and ES512 signature algorithms.
12+
813
Fixes:
914

1015
* Fixed various typos and mistakes in JavaDocs.

webauthn-server-attestation/src/test/scala/com/yubico/fido/metadata/FidoMds3Spec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class FidoMds3Spec extends FunSpec with Matchers {
312312
attestationMaker = AttestationMaker.packed(
313313
AttestationSigner.ca(
314314
COSEAlgorithmIdentifier.ES256,
315-
aaguid = aaguidA.asBytes,
315+
aaguid = Some(aaguidA.asBytes),
316316
validFrom = CertValidFrom,
317317
validTo = CertValidTo,
318318
)

webauthn-server-core/src/main/java/com/yubico/webauthn/TpmAttestationStatementVerifier.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ final class TpmAttestationStatementVerifier
5959
implements AttestationStatementVerifier, X5cAttestationStatementVerifier {
6060

6161
private static final String TPM_VER = "2.0";
62-
private static final ByteArray TPM_GENERATED_VALUE = ByteArray.fromBase64("/1RDRw==");
63-
private static final ByteArray TPM_ST_ATTEST_CERTIFY = ByteArray.fromBase64("gBc=");
62+
static final ByteArray TPM_GENERATED_VALUE = ByteArray.fromBase64("/1RDRw==");
63+
static final ByteArray TPM_ST_ATTEST_CERTIFY = ByteArray.fromBase64("gBc=");
6464

65-
private static final int TPM_ALG_NULL = 0x0010;
65+
static final int TPM_ALG_NULL = 0x0010;
6666

6767
private static final String OID_TCG_AT_TPM_MANUFACTURER = "2.23.133.2.1";
6868
private static final String OID_TCG_AT_TPM_MODEL = "2.23.133.2.2";
@@ -74,7 +74,7 @@ final class TpmAttestationStatementVerifier
7474
* <p>see section 8.3 of
7575
* https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
7676
*/
77-
private static final class Attributes {
77+
static final class Attributes {
7878
public static final int SIGN_ENCRYPT = 1 << 18;
7979

8080
private static final int SHALL_BE_ZERO =
@@ -359,7 +359,7 @@ private void verifyPublicKeysMatch(AttestationObject attestationObject, TpmtPubl
359359
}
360360
}
361361

362-
private static final class TpmAlgAsym {
362+
static final class TpmAlgAsym {
363363
public static final int RSA = 0x0001;
364364
public static final int ECC = 0x0023;
365365
}
@@ -463,7 +463,7 @@ public ByteArray name() {
463463
}
464464
}
465465

466-
private static class TpmAlgHash {
466+
static class TpmAlgHash {
467467
public static final int SHA1 = 0x0004;
468468
public static final int SHA256 = 0x000B;
469469
public static final int SHA384 = 0x000C;
@@ -528,7 +528,7 @@ public void verifyX5cRequirements(X509Certificate cert, ByteArray aaguid)
528528
});
529529
}
530530

531-
private static final class TpmRsaScheme {
531+
static final class TpmRsaScheme {
532532
public static final int RSASSA = 0x0014;
533533
}
534534

webauthn-server-core/src/test/scala/com/yubico/webauthn/RegistrationTestData.scala

Lines changed: 252 additions & 9 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)