1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-15 10:25:21 +01:00

Send error when failing to decrypt message

This commit is contained in:
Hinton 2020-10-23 14:40:31 +02:00
parent 470df8f589
commit da0cd3d588

View File

@ -51,6 +51,12 @@ export class NativeMessagingService {
const message = JSON.parse(await this.cryptoService.decryptToUtf8(rawMessage, this.sharedSecret));
// Shared secret is invalidated, force re-authentication
if (message == null) {
ipcRenderer.send('nativeMessagingReply', {command: 'invalidateEncryption'});
return;
}
if (Math.abs(message.timestamp - Date.now()) > MessageValidTimeout) {
this.logService.error('NativeMessage is to old, ignoring.');
return;