From 55bd9757e755ce377fc17b52b2eed51f705a32c5 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Wed, 3 Feb 2016 11:39:06 +0700 Subject: [PATCH] Refactor config.useWebCrypto to config.useNative --- src/config/config.js | 5 +++-- src/util.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/config/config.js b/src/config/config.js index 5ff9fba4..cb8561b4 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -29,6 +29,8 @@ * @module config/config */ +'use strict'; + var enums = require('../enums.js'); module.exports = { @@ -40,8 +42,7 @@ module.exports = { // fail on decrypt if message is not integrity protected ignore_mdc_error: false, rsa_blinding: true, - useWebCrypto: true, - useNative: false, // Node crypto library for AES + useNative: true, // use native node.js crypto and Web Crypto apis (if available) show_version: true, show_comment: true, diff --git a/src/util.js b/src/util.js index 50057fc3..a0d7af54 100644 --- a/src/util.js +++ b/src/util.js @@ -396,11 +396,11 @@ module.exports = { /** * Get native Web Cryptography api. The default configuration is to use - * the api when available. But it can also be deactivated with config.useWebCrypto + * the api when available. But it can also be deactivated with config.useNative * @return {Object} The SubtleCrypto api or 'undefined' */ getWebCrypto: function() { - if (config.useWebCrypto === false) { + if (!config.useNative) { // make web crypto optional return; }