Skip to content

Commit d7cdb6e

Browse files
committed
switch auto-reboot unit to seconds
1 parent 81e0b6f commit d7cdb6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/app/attestation/server/AttestationProtocol.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class AttestationProtocol {
7878
// byte[] compressedChain { [short encodedCertificateLength, byte[] encodedCertificate] }
7979
// byte[] fingerprint (length: FINGERPRINT_LENGTH)
8080
// int osEnforcedFlags
81-
// short autoRebootMinutes (-1 for unknown)
81+
// int autoRebootSeconds (-1 for unknown)
8282
// byte portSecurityMode (-1 for unknown)
8383
// byte userCount (-1 for unknown)
8484
// byte oemUnlockAllowed (-1 for unknown)
@@ -87,7 +87,7 @@ class AttestationProtocol {
8787
//
8888
// Protocol version changes:
8989
//
90-
// 6: autoRebootMinutes added
90+
// 6: autoRebootSeconds added
9191
// 6: portSecurityMode added
9292
// 6: userCount added
9393
// 6: oemUnlockAllowed added
@@ -1123,7 +1123,7 @@ static Certificate[] decodeChain(final byte[] dictionary, final byte[] compresse
11231123
final ByteBuffer chainDeserializer = ByteBuffer.wrap(chain, 0, chainLength);
11241124
final List<Certificate> certs = new ArrayList<>();
11251125
while (chainDeserializer.hasRemaining()) {
1126-
final short encodedLength = chainDeserializer.getShort();
1126+
final short encodedLength = chainDeserializer.getInt();
11271127
final byte[] encoded = new byte[encodedLength];
11281128
chainDeserializer.get(encoded);
11291129
certs.add(generateCertificate(new ByteArrayInputStream(encoded)));
@@ -1200,7 +1200,7 @@ static void verifySerialized(final byte[] attestationResult,
12001200
}
12011201

12021202
if (version >= 6) {
1203-
final short autoRebootMinutes = deserializer.getShort();
1203+
final int autoRebootSeconds = deserializer.getShort();
12041204
final byte portSecurityMode = deserializer.get();
12051205
final byte userCount = deserializer.get();
12061206
final byte oemUnlockAllowed = deserializer.get();

0 commit comments

Comments
 (0)