#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) => {
|
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
||||||
|
let allowSkipVerification = false;
|
||||||
|
|
||||||
let tempSig;
|
let tempSig;
|
||||||
let tempPub;
|
let tempPub;
|
||||||
const cleanupFiles = () => {
|
const cleanupFiles = () => {
|
||||||
@@ -723,6 +725,7 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
|||||||
const errorHandler = err => {
|
const errorHandler = err => {
|
||||||
cleanupFiles();
|
cleanupFiles();
|
||||||
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
|
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
|
||||||
|
AllowSkipVerification: allowSkipVerification,
|
||||||
Source: data.Source,
|
Source: data.Source,
|
||||||
}, err);
|
}, err);
|
||||||
};
|
};
|
||||||
|
|||||||
15
src/App.js
15
src/App.js
@@ -300,7 +300,7 @@ class App extends IPCContainer {
|
|||||||
this.sendRequest(Constants.IPC_Install_Upgrade, {
|
this.sendRequest(Constants.IPC_Install_Upgrade, {
|
||||||
Sha256: sha256,
|
Sha256: sha256,
|
||||||
Signature: signature,
|
Signature: signature,
|
||||||
SkipVerification: false,
|
SkipVerification: !!data.SkipVerification,
|
||||||
Source: data.Destination,
|
Source: data.Destination,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -507,6 +507,19 @@ class App extends IPCContainer {
|
|||||||
DownloadActive: false,
|
DownloadActive: false,
|
||||||
DownloadProgress: 0.0,
|
DownloadProgress: 0.0,
|
||||||
DownloadName: '',
|
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