mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-27 04:03:00 +02:00
Handle special serialization case for native messaging. (#3442)
It would be nice to fix this by processing the encString properly in Desktop, but that wouldn't be backwards compatible with existing installs.
This commit is contained in:
parent
ef50055e32
commit
123db002dc
@ -238,7 +238,18 @@ export class NativeMessagingBackground {
|
||||
private postMessage(message: OuterMessage) {
|
||||
// Wrap in try-catch to when the port disconnected without triggering `onDisconnect`.
|
||||
try {
|
||||
this.port.postMessage(message);
|
||||
const msg: any = message;
|
||||
if (message.message instanceof EncString) {
|
||||
// Alternative, backwards-compatible serialization of EncString
|
||||
msg.message = {
|
||||
encryptedString: message.message.encryptedString,
|
||||
encryptionType: message.message.encryptionType,
|
||||
data: message.message.data,
|
||||
iv: message.message.iv,
|
||||
mac: message.message.mac,
|
||||
};
|
||||
}
|
||||
this.port.postMessage(msg);
|
||||
} catch (e) {
|
||||
this.logService.error("NativeMessaging port disconnected, disconnecting.");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user