Skip to content

Commit ec4d8d9

Browse files
committed
Reduce visibility of internals in TpmAttestationStatementVerifier
1 parent 23846c1 commit ec4d8d9

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ final class TpmAttestationStatementVerifier
7575
* https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf
7676
*/
7777
static final class Attributes {
78-
public static final int SIGN_ENCRYPT = 1 << 18;
78+
static final int SIGN_ENCRYPT = 1 << 18;
7979

8080
private static final int SHALL_BE_ZERO =
8181
(1 << 0) // 0 Reserved
@@ -360,8 +360,8 @@ private void verifyPublicKeysMatch(AttestationObject attestationObject, TpmtPubl
360360
}
361361

362362
static final class TpmAlgAsym {
363-
public static final int RSA = 0x0001;
364-
public static final int ECC = 0x0023;
363+
static final int RSA = 0x0001;
364+
static final int ECC = 0x0023;
365365
}
366366

367367
private interface Parameters {}
@@ -376,7 +376,7 @@ private static class TpmtPublic {
376376
Unique unique;
377377
ByteArray rawBytes;
378378

379-
public static TpmtPublic parse(byte[] pubArea) throws IOException {
379+
private static TpmtPublic parse(byte[] pubArea) throws IOException {
380380
try (ByteInputStream reader = new ByteInputStream(pubArea)) {
381381
final int signAlg = reader.readUnsignedShort();
382382
final int nameAlg = reader.readUnsignedShort();
@@ -433,7 +433,7 @@ public static TpmtPublic parse(byte[] pubArea) throws IOException {
433433
* nvPublicArea contents of the TPMS_NV_PUBLIC associated with handle
434434
* </pre>
435435
*/
436-
public ByteArray name() {
436+
private ByteArray name() {
437437
final ByteArray hash;
438438
switch (this.nameAlg) {
439439
case TpmAlgHash.SHA1:
@@ -464,13 +464,13 @@ public ByteArray name() {
464464
}
465465

466466
static class TpmAlgHash {
467-
public static final int SHA1 = 0x0004;
468-
public static final int SHA256 = 0x000B;
469-
public static final int SHA384 = 0x000C;
470-
public static final int SHA512 = 0x000D;
467+
static final int SHA1 = 0x0004;
468+
static final int SHA256 = 0x000B;
469+
static final int SHA384 = 0x000C;
470+
static final int SHA512 = 0x000D;
471471
}
472472

473-
public void verifyX5cRequirements(X509Certificate cert, ByteArray aaguid)
473+
private void verifyX5cRequirements(X509Certificate cert, ByteArray aaguid)
474474
throws CertificateParsingException {
475475
ExceptionUtil.assure(
476476
cert.getVersion() == 3,
@@ -529,7 +529,7 @@ public void verifyX5cRequirements(X509Certificate cert, ByteArray aaguid)
529529
}
530530

531531
static final class TpmRsaScheme {
532-
public static final int RSASSA = 0x0014;
532+
static final int RSASSA = 0x0014;
533533
}
534534

535535
/**
@@ -542,7 +542,7 @@ private static class TpmsRsaParms implements Parameters {
542542

543543
long exponent;
544544

545-
public static TpmsRsaParms parse(ByteInputStream reader) throws IOException {
545+
private static TpmsRsaParms parse(ByteInputStream reader) throws IOException {
546546
final int symmetric = reader.readUnsignedShort();
547547
ExceptionUtil.assure(
548548
symmetric == TPM_ALG_NULL,
@@ -573,7 +573,7 @@ public static TpmsRsaParms parse(ByteInputStream reader) throws IOException {
573573
private static class Tpm2bPublicKeyRsa implements Unique {
574574
ByteArray bytes;
575575

576-
public static Tpm2bPublicKeyRsa parse(ByteInputStream reader) throws IOException {
576+
private static Tpm2bPublicKeyRsa parse(ByteInputStream reader) throws IOException {
577577
return new Tpm2bPublicKeyRsa(new ByteArray(reader.read(reader.readUnsignedShort())));
578578
}
579579
}
@@ -582,7 +582,7 @@ public static Tpm2bPublicKeyRsa parse(ByteInputStream reader) throws IOException
582582
private static class TpmsEccParms implements Parameters {
583583
int curve_id;
584584

585-
public static TpmsEccParms parse(ByteInputStream reader) throws IOException {
585+
private static TpmsEccParms parse(ByteInputStream reader) throws IOException {
586586
final int symmetric = reader.readUnsignedShort();
587587
final int scheme = reader.readUnsignedShort();
588588
ExceptionUtil.assure(
@@ -614,7 +614,7 @@ private static class TpmsEccPoint implements Unique {
614614
ByteArray x;
615615
ByteArray y;
616616

617-
public static TpmsEccPoint parse(ByteInputStream reader) throws IOException {
617+
private static TpmsEccPoint parse(ByteInputStream reader) throws IOException {
618618
final ByteArray x = new ByteArray(reader.read(reader.readUnsignedShort()));
619619
final ByteArray y = new ByteArray(reader.read(reader.readUnsignedShort()));
620620

@@ -630,10 +630,10 @@ public static TpmsEccPoint parse(ByteInputStream reader) throws IOException {
630630
*/
631631
private static class TpmEccCurve {
632632

633-
public static final int NONE = 0x0000;
634-
public static final int NIST_P256 = 0x0003;
635-
public static final int NIST_P384 = 0x0004;
636-
public static final int NIST_P521 = 0x0005;
633+
private static final int NONE = 0x0000;
634+
private static final int NIST_P256 = 0x0003;
635+
private static final int NIST_P384 = 0x0004;
636+
private static final int NIST_P521 = 0x0005;
637637
}
638638

639639
/**

0 commit comments

Comments
 (0)