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

View File

@@ -5,10 +5,11 @@ export const getHardwareConfigFromDeviceResponse = (json: string): HardwareConfi
const hardwareConfig = new HardwareConfiguration();
hardwareConfig.fromBinary(UhkBuffer.fromArray(data));
if (hardwareConfig.uniqueId > 0) {
return hardwareConfig;
if (hardwareConfig.signature !== 'UHK') {
throw Error('Invalid hardware configuration');
}
return null;
return hardwareConfig;
};
export const getUserConfigFromDeviceResponse = (json: string): UserConfiguration => {