#21: Add signature validation during installations
This commit is contained in:
@@ -706,6 +706,8 @@ ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
||||
let allowSkipVerification = false;
|
||||
|
||||
let tempSig;
|
||||
let tempPub;
|
||||
const cleanupFiles = () => {
|
||||
@@ -723,6 +725,7 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
||||
const errorHandler = err => {
|
||||
cleanupFiles();
|
||||
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
|
||||
AllowSkipVerification: allowSkipVerification,
|
||||
Source: data.Source,
|
||||
}, err);
|
||||
};
|
||||
|
||||
15
src/App.js
15
src/App.js
@@ -300,7 +300,7 @@ class App extends IPCContainer {
|
||||
this.sendRequest(Constants.IPC_Install_Upgrade, {
|
||||
Sha256: sha256,
|
||||
Signature: signature,
|
||||
SkipVerification: false,
|
||||
SkipVerification: !!data.SkipVerification,
|
||||
Source: data.Destination,
|
||||
});
|
||||
} else {
|
||||
@@ -507,6 +507,19 @@ class App extends IPCContainer {
|
||||
DownloadActive: false,
|
||||
DownloadProgress: 0.0,
|
||||
DownloadName: '',
|
||||
}, () => {
|
||||
if (!arg.data.Success) {
|
||||
this.setErrorState(arg.data.Error, () => {
|
||||
// TODO Prompt to verify
|
||||
if (arg.data.AllowSkipVerification) {
|
||||
this.installUpgrade( {
|
||||
SkipVerification: true,
|
||||
Source: arg.data.Source,
|
||||
Success: true,
|
||||
});
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user