Check the signature of the hardware configuration area instead of uniqueId.
This commit is contained in:
@@ -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 => {
|
||||||
|
|||||||
Reference in New Issue
Block a user