From d0b67cb4208ecfe60f79db98fb60c919edcb344e Mon Sep 17 00:00:00 2001 From: stevenlele Date: Mon, 31 Jul 2023 18:29:01 +0800 Subject: [PATCH] fix: warn if failed to decrypt master key --- browser/chromium/chromium_windows.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/chromium/chromium_windows.go b/browser/chromium/chromium_windows.go index cee9a0b..bbe26b3 100644 --- a/browser/chromium/chromium_windows.go +++ b/browser/chromium/chromium_windows.go @@ -34,6 +34,10 @@ func (c *Chromium) GetMasterKey() ([]byte, error) { return nil, errDecodeMasterKeyFailed } c.masterKey, err = crypto.DPAPI(key[5:]) + if err != nil { + log.Errorf("%s failed to decrypt master key, maybe this profile was created on a different OS installation", c.name) + return nil, err + } log.Infof("%s initialized master key success", c.name) - return c.masterKey, err + return c.masterKey, nil }