From 5b3fd4530e95e1880abb178f7bf2f18d6d2aba1f Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Thu, 21 Feb 2019 15:36:12 +0000 Subject: [PATCH] Bug 1529495 - Output the result of ::GetLastError when CryptProtectData\CryptUnprotectData fails. r=MattN Differential Revision: https://phabricator.services.mozilla.com/D20627 --HG-- extra : moz-landing-system : lando --- toolkit/components/passwordmgr/OSCrypto_win.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkit/components/passwordmgr/OSCrypto_win.js b/toolkit/components/passwordmgr/OSCrypto_win.js index b16e54f932f3..3dd09e69d518 100644 --- a/toolkit/components/passwordmgr/OSCrypto_win.js +++ b/toolkit/components/passwordmgr/OSCrypto_win.js @@ -167,7 +167,7 @@ OSCrypto.prototype = { null, null, FLAGS_NOT_SET, outData.address()); if (status === 0) { - throw new Error("decryptData failed: " + status); + throw new Error("decryptData failed: " + ctypes.winLastError); } // convert byte array to JS string. @@ -213,7 +213,7 @@ OSCrypto.prototype = { null, null, FLAGS_NOT_SET, outData.address()); if (status === 0) { - throw new Error("encryptData failed: " + status); + throw new Error("encryptData failed: " + ctypes.winLastError); } // convert byte array to JS string.