mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-13 14:53:46 +00:00
Fixed bug with hash of signed binaries when doing JS update
This commit is contained in:
@@ -375,7 +375,7 @@ server.on('upgrade', function (msg, sck, head)
|
|||||||
b.writeUInt16BE(1, 2);
|
b.writeUInt16BE(1, 2);
|
||||||
this.write(b);
|
this.write(b);
|
||||||
|
|
||||||
this.command({ url: 'https://127.0.0.1:9250/update', action: 'agentupdate', hash: getSHA384FileHash(getCurrentUpdatePath()).toString('hex'), sessionid: 'none' });
|
this.command({ url: 'https://127.0.0.1:9250/update', action: 'agentupdate', hash: require('SHA384Stream').create().syncHash(require('fs').readFileSync(getCurrentUpdatePath())).toString('hex').toLocaleLowerCase(), sessionid: 'none' });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('Agent Update State: ' + updateState);
|
console.log('Agent Update State: ' + updateState);
|
||||||
@@ -443,7 +443,7 @@ server.on('upgrade', function (msg, sck, head)
|
|||||||
b.writeUInt16BE(MeshCommand_CoreOk);
|
b.writeUInt16BE(MeshCommand_CoreOk);
|
||||||
b.writeUInt16BE(1, 2);
|
b.writeUInt16BE(1, 2);
|
||||||
this.write(b);
|
this.write(b);
|
||||||
this.command({ url: 'https://127.0.0.1:9250/update', action: 'agentupdate', hash: getSHA384FileHash(getCurrentUpdatePath()).toString('hex'), sessionid: 'none' });
|
this.command({ url: 'https://127.0.0.1:9250/update', action: 'agentupdate', hash: require('SHA384Stream').create().syncHash(require('fs').readFileSync(getCurrentUpdatePath())).toString('hex').toLocaleLowerCase(), sessionid: 'none' });
|
||||||
break;
|
break;
|
||||||
case 99:
|
case 99:
|
||||||
// No-Op because we are done
|
// No-Op because we are done
|
||||||
|
|||||||
Reference in New Issue
Block a user