Check the signature of the hardware configuration area instead of uniqueId.

This commit is contained in:
László Monda
2018-05-19 14:07:18 +02:00
parent 3c056a7255
commit 2cf8044987
+4 -3
View File
@@ -5,10 +5,11 @@ export const getHardwareConfigFromDeviceResponse = (json: string): HardwareConfi
const hardwareConfig = new HardwareConfiguration(); const hardwareConfig = new HardwareConfiguration();
hardwareConfig.fromBinary(UhkBuffer.fromArray(data)); hardwareConfig.fromBinary(UhkBuffer.fromArray(data));
if (hardwareConfig.uniqueId > 0) { if (hardwareConfig.signature !== 'UHK') {
return hardwareConfig; throw Error('Invalid hardware configuration');
} }
return null;
return hardwareConfig;
}; };
export const getUserConfigFromDeviceResponse = (json: string): UserConfiguration => { export const getUserConfigFromDeviceResponse = (json: string): UserConfiguration => {