diff --git a/build/pmcrypto.js b/build/pmcrypto.js index bc952657..3b712b87 100644 --- a/build/pmcrypto.js +++ b/build/pmcrypto.js @@ -180,7 +180,7 @@ function decryptPrivateKey(privKey, privKeyPassCode) { return keys[0]; } - return Promise.reject(new Error('Private key decryption failed')); // Do NOT make this an Error object + return Promise.reject(new Error('Private key decryption failed')); }); } @@ -200,12 +200,12 @@ function decryptSessionKey(options) { return result; }).catch(function (err) { - console.log(err); - return Promise.reject(new Error('Session key decryption failed')); + console.error(err); + return Promise.reject(err); }); } catch (err) { if (err.message === 'CFB decrypt: invalid key' && options.passwords && options.passwords.length) { - return Promise.reject(new Error('Incorrect message password')); // Bad password, reject without Error object + return Promise.reject(new Error('Incorrect message password')); } return Promise.reject(err); } @@ -532,8 +532,8 @@ function decryptMessage(options) { return { data: data, filename: filename, verified: verified, signatures: signatures }; }).catch(function (err) { - console.log(err); - return Promise.reject(new Error('Decryption failed')); + console.error(err); + return Promise.reject(err); }); } catch (err) { if (err.message === 'CFB decrypt: invalid key' && options.passwords && options.passwords.length) { @@ -621,7 +621,7 @@ function encryptMessage(options) { module.exports = encryptMessage; },{}],11:[function(require,module,exports){ -'use strict'; +"use strict"; function getMessage(message) { @@ -666,8 +666,8 @@ function createMessage(source) { function signMessage(options) { return openpgp.sign(options).catch(function (err) { - console.log(err); - return Promise.reject(new Error('Message signing failed')); + console.error(err); + return Promise.reject(err); }); } @@ -692,8 +692,8 @@ function verifyMessage(options) { } return { data: data, verified: verified, signatures: signatures }; }).catch(function (err) { - console.log(err); - return Promise.reject(new Error('Message verification failed')); + console.error(err); + return Promise.reject(err); }); } diff --git a/lib/key/decrypt.js b/lib/key/decrypt.js index fbc797d5..ac6ae224 100644 --- a/lib/key/decrypt.js +++ b/lib/key/decrypt.js @@ -18,7 +18,7 @@ function decryptPrivateKey(privKey, privKeyPassCode) { return keys[0]; } - return Promise.reject(new Error('Private key decryption failed')); // Do NOT make this an Error object + return Promise.reject(new Error('Private key decryption failed')); }); } @@ -41,12 +41,12 @@ function decryptSessionKey(options) { return result; }) .catch((err) => { - console.log(err); - return Promise.reject(new Error('Session key decryption failed')); + console.error(err); + return Promise.reject(err); }); } catch (err) { if (err.message === 'CFB decrypt: invalid key' && options.passwords && options.passwords.length) { - return Promise.reject(new Error('Incorrect message password')); // Bad password, reject without Error object + return Promise.reject(new Error('Incorrect message password')); } return Promise.reject(err); } diff --git a/lib/message/decrypt.js b/lib/message/decrypt.js index e4dc1f37..9fcd92b9 100644 --- a/lib/message/decrypt.js +++ b/lib/message/decrypt.js @@ -47,8 +47,8 @@ function decryptMessage(options) { return { data, filename, verified, signatures }; }) .catch((err) => { - console.log(err); - return Promise.reject(new Error('Decryption failed')); + console.error(err); + return Promise.reject(err); }); } catch (err) { if (err.message === 'CFB decrypt: invalid key' && options.passwords && options.passwords.length) { diff --git a/lib/message/utils.js b/lib/message/utils.js index 96bb8a9a..14643d28 100644 --- a/lib/message/utils.js +++ b/lib/message/utils.js @@ -42,8 +42,8 @@ function signMessage(options) { return openpgp.sign(options) .catch((err) => { - console.log(err); - return Promise.reject(new Error('Message signing failed')); + console.error(err); + return Promise.reject(err); }); } @@ -67,8 +67,8 @@ function verifyMessage(options) { return {data, verified, signatures}; }) .catch(function(err) { - console.log(err); - return Promise.reject(new Error('Message verification failed')); + console.error(err); + return Promise.reject(err); }); } diff --git a/package.json b/package.json index 7c0b9b4b..92f0dceb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pmcrypto", - "version": "2.0.4", + "version": "2.0.5", "description": "", "main": "index.js", "scripts": { @@ -21,7 +21,7 @@ "btoa": "*", "atob": "*", "es6-promise": "*", - "openpgp": "2.5.12" + "openpgp": "2.6.1" }, "devDependencies": { "babel-plugin-istanbul": "^4.1.4",