Skip to content

Commit b40d2cc

Browse files
committed
properly handle legacy device support removal
1 parent baf8161 commit b40d2cc

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,21 +1574,15 @@ private static void writeDevicesJson(final HttpExchange exchange, final long use
15741574
info = fingerprintsStrongBoxCustomOS.get(verifiedBootKey);
15751575
if (info == null) {
15761576
info = fingerprintsStrongBoxStock.get(verifiedBootKey);
1577-
if (info == null) {
1578-
throw new RuntimeException("invalid fingerprint");
1579-
}
15801577
}
15811578
} else {
15821579
info = fingerprintsCustomOS.get(verifiedBootKey);
15831580
if (info == null) {
15841581
info = fingerprintsStock.get(verifiedBootKey);
1585-
if (info == null) {
1586-
throw new RuntimeException("invalid fingerprint");
1587-
}
15881582
}
15891583
}
1590-
device.add("osName", info.osName());
1591-
device.add("name", info.name());
1584+
device.add("osName", info != null ? info.osName() : "Unknown (legacy device)");
1585+
device.add("name", info != null ? info.name() : "Unknown (legacy device)");
15921586
if (!select.columnNull(4)) {
15931587
device.add("verifiedBootHash", select.columnString(4));
15941588
}
@@ -1631,7 +1625,7 @@ private static void writeDevicesJson(final HttpExchange exchange, final long use
16311625
device.add("verifiedTimeLast", select.columnLong(25));
16321626
device.add("minId", select.columnLong(26));
16331627
device.add("maxId", select.columnLong(27));
1634-
device.add("hasPogoPins", info.hasPogoPins() ? 1 : 0);
1628+
device.add("hasPogoPins", info != null && info.hasPogoPins() ? 1 : 0);
16351629
devices.add(device);
16361630
}
16371631
} finally {

0 commit comments

Comments
 (0)