Skip to content

Commit

Permalink
add fields for protocol version 6
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Oct 1, 2024
1 parent 6963539 commit 1376ac2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/app/attestation/server/AttestationProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ class AttestationProtocol {
// byte[] compressedChain { [short encodedCertificateLength, byte[] encodedCertificate] }
// byte[] fingerprint (length: FINGERPRINT_LENGTH)
// int osEnforcedFlags
// short autoRebootMinutes (-1 for unknown)
// byte portSecurityMode (-1 for unknown)
// byte userCount (-1 for unknown)
// }
// byte[] signature (rest of message)
//
// Protocol version changes:
//
// 6: autoRebootMinutes added
// 6: portSecurityMode added
// 6: userCount added
//
// n/a
//
// For each audit, the Auditee generates a fresh hardware-backed key with key attestation
Expand Down Expand Up @@ -1177,6 +1184,12 @@ static void verifySerialized(final byte[] attestationResult,
throw new GeneralSecurityException("invalid device administrator state");
}

if (version >= 6) {
final short autoRebootMinutes = deserializer.getShort();
final byte portSecurityMode = deserializer.get();
final byte userCount = deserializer.get();
}

final int signatureLength = deserializer.remaining();
final byte[] signature = new byte[signatureLength];
deserializer.get(signature);
Expand Down

0 comments on commit 1376ac2

Please sign in to comment.