From 023e9a8c62687eed0ff46f7272bcfea521c59f0a Mon Sep 17 00:00:00 2001 From: Shane Tomlinson Date: Wed, 26 Sep 2018 12:34:24 +0100 Subject: [PATCH] feat(a256gcm): Ban unsafeExplicitIV by default. Use grunt-ban-words to ban unsafeExplicitIV except where expected. --- grunttasks/ban-word.js | 14 ++++++++++++++ grunttasks/lint.js | 1 + npm-shrinkwrap.json | 6 ++++++ package.json | 1 + 4 files changed, 22 insertions(+) create mode 100644 grunttasks/ban-word.js diff --git a/grunttasks/ban-word.js b/grunttasks/ban-word.js new file mode 100644 index 000000000..05f62dcec --- /dev/null +++ b/grunttasks/ban-word.js @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +module.exports = function (grunt) { + grunt.config('word', { + unsafeExplicitIV: { + options: { + banList: ['unsafeExplicitIV'] + }, + src: ['app/scripts/**/*.js', '!app/scripts/lib/crypto/a256gcm.js', '!app/scripts/lib/crypto/recovery-keys.js'] + } + }); +}; diff --git a/grunttasks/lint.js b/grunttasks/lint.js index 4c2bed74b..ba1f8a562 100644 --- a/grunttasks/lint.js +++ b/grunttasks/lint.js @@ -8,6 +8,7 @@ module.exports = function (grunt) { var SUBTASKS = [ 'eslint', + 'word', 'jsonlint:app', 'sasslint' ]; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d486f8326..b7543f6ef 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -6900,6 +6900,12 @@ "babel-core": "^6.0.12" } }, + "grunt-ban-word": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/grunt-ban-word/-/grunt-ban-word-0.1.1.tgz", + "integrity": "sha1-5E7cSwzBX9hp4b0VrEsSMuLtQlA=", + "dev": true + }, "grunt-bump": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/grunt-bump/-/grunt-bump-0.7.0.tgz", diff --git a/package.json b/package.json index df7ea8832..169dfcbe1 100644 --- a/package.json +++ b/package.json @@ -132,6 +132,7 @@ "eslint-plugin-sorting": "git://github.com/shane-tomlinson/eslint-plugin-sorting.git#bcacb99d", "firefox-profile": "1.2.0", "fxa-conventional-changelog": "1.1.0", + "grunt-ban-word": "0.1.1", "grunt-bump": "0.7.0", "grunt-conventional-changelog": "6.1.0", "grunt-copyright": "0.3.0",