Updated many dependencies including Webpack (v4) and crypto-api (v0.8)

This commit is contained in:
n1474335 2018-03-01 19:45:34 +00:00
parent ead64dcb47
commit 574207c626
6 changed files with 2813 additions and 1780 deletions

View File

@ -185,6 +185,7 @@ module.exports = function (grunt) {
webpack: { webpack: {
options: webpackConfig, options: webpackConfig,
metaConf: { metaConf: {
mode: "production",
target: "node", target: "node",
entry: [ entry: [
"babel-polyfill", "babel-polyfill",
@ -200,6 +201,7 @@ module.exports = function (grunt) {
externals: [NodeExternals()], externals: [NodeExternals()],
}, },
metaConfDev: { metaConfDev: {
mode: "development",
target: "node", target: "node",
entry: [ entry: [
"babel-polyfill", "babel-polyfill",
@ -216,6 +218,7 @@ module.exports = function (grunt) {
watch: true watch: true
}, },
web: { web: {
mode: "production",
target: "web", target: "web",
entry: Object.assign({ entry: Object.assign({
main: "./src/web/index.js", main: "./src/web/index.js",
@ -231,15 +234,6 @@ module.exports = function (grunt) {
}, },
plugins: [ plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS), new webpack.DefinePlugin(BUILD_CONSTANTS),
new webpack.optimize.UglifyJsPlugin({
compress: {
"screw_ie8": true,
"dead_code": true,
"unused": true,
"warnings": false
},
comments: false,
}),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: "index.html", filename: "index.html",
template: "./src/web/html/index.html", template: "./src/web/html/index.html",
@ -256,6 +250,7 @@ module.exports = function (grunt) {
] ]
}, },
webInline: { webInline: {
mode: "production",
target: "web", target: "web",
entry: "./src/web/index.js", entry: "./src/web/index.js",
output: { output: {
@ -264,15 +259,6 @@ module.exports = function (grunt) {
}, },
plugins: [ plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS), new webpack.DefinePlugin(BUILD_CONSTANTS),
new webpack.optimize.UglifyJsPlugin({
compress: {
"screw_ie8": true,
"dead_code": true,
"unused": true,
"warnings": false
},
comments: false,
}),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: "cyberchef.htm", filename: "cyberchef.htm",
template: "./src/web/html/index.html", template: "./src/web/html/index.html",
@ -289,6 +275,7 @@ module.exports = function (grunt) {
] ]
}, },
tests: { tests: {
mode: "development",
target: "node", target: "node",
entry: "./test/index.js", entry: "./test/index.js",
externals: [NodeExternals()], externals: [NodeExternals()],
@ -301,6 +288,7 @@ module.exports = function (grunt) {
] ]
}, },
node: { node: {
mode: "production",
target: "node", target: "node",
entry: "./src/node/index.js", entry: "./src/node/index.js",
externals: [NodeExternals()], externals: [NodeExternals()],
@ -327,11 +315,13 @@ module.exports = function (grunt) {
children: false, children: false,
chunks: false, chunks: false,
modules: false, modules: false,
entrypoints: false,
warningsFilter: /source-map/, warningsFilter: /source-map/,
} }
}, },
start: { start: {
webpack: { webpack: {
mode: "development",
target: "web", target: "web",
entry: Object.assign({ entry: Object.assign({
main: "./src/web/index.js" main: "./src/web/index.js"

4477
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -31,15 +31,15 @@
"bugs": "https://github.com/gchq/CyberChef/issues", "bugs": "https://github.com/gchq/CyberChef/issues",
"devDependencies": { "devDependencies": {
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-loader": "^7.1.2", "babel-loader": "^7.1.3",
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"css-loader": "^0.28.9", "css-loader": "^0.28.10",
"eslint": "^4.17.0", "eslint": "^4.18.1",
"exports-loader": "^0.6.4", "exports-loader": "^0.7.0",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^4.0.0-alpha0",
"file-loader": "^1.1.6", "file-loader": "^1.1.10",
"grunt": ">=1.0.1", "grunt": ">=1.0.2",
"grunt-accessibility": "~5.0.0", "grunt-accessibility": "~6.0.0",
"grunt-chmod": "~1.1.1", "grunt-chmod": "~1.1.1",
"grunt-concurrent": "^2.3.1", "grunt-concurrent": "^2.3.1",
"grunt-contrib-clean": "~1.1.0", "grunt-contrib-clean": "~1.1.0",
@ -49,24 +49,24 @@
"grunt-execute": "^0.2.2", "grunt-execute": "^0.2.2",
"grunt-jsdoc": "^2.2.1", "grunt-jsdoc": "^2.2.1",
"grunt-webpack": "^3.0.2", "grunt-webpack": "^3.0.2",
"html-webpack-plugin": "^2.30.1", "html-webpack-plugin": "^3.0.4",
"imports-loader": "^0.7.1", "imports-loader": "^0.8.0",
"ink-docstrap": "^1.3.2", "ink-docstrap": "^1.3.2",
"jsdoc-babel": "^0.3.0", "jsdoc-babel": "^0.3.0",
"less": "^2.7.3", "less": "^3.0.1",
"less-loader": "^4.0.5", "less-loader": "^4.0.6",
"postcss-css-variables": "^0.8.0", "postcss-css-variables": "^0.8.0",
"postcss-import": "^11.0.0", "postcss-import": "^11.1.0",
"postcss-loader": "^2.0.10", "postcss-loader": "^2.1.1",
"sitemap": "^1.13.0", "sitemap": "^1.13.0",
"style-loader": "^0.19.1", "style-loader": "^0.20.2",
"url-loader": "^0.6.2", "url-loader": "^0.6.2",
"val-loader": "^1.1.0", "val-loader": "^1.1.0",
"web-resource-inliner": "^4.2.1", "web-resource-inliner": "^4.2.1",
"webpack": "^3.10.0", "webpack": "^4.0.1",
"webpack-dev-server": "^2.11.1", "webpack-dev-server": "^3.1.0",
"webpack-node-externals": "^1.6.0", "webpack-node-externals": "^1.6.0",
"worker-loader": "^1.1.0" "worker-loader": "^1.1.1"
}, },
"dependencies": { "dependencies": {
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
@ -74,10 +74,10 @@
"bootstrap": "^3.3.7", "bootstrap": "^3.3.7",
"bootstrap-colorpicker": "^2.5.2", "bootstrap-colorpicker": "^2.5.2",
"bootstrap-switch": "^3.3.4", "bootstrap-switch": "^3.3.4",
"crypto-api": "^0.7.5", "crypto-api": "^0.8.0",
"crypto-js": "^3.1.9-1", "crypto-js": "^3.1.9-1",
"diff": "^3.4.0", "diff": "^3.4.0",
"escodegen": "^1.9.0", "escodegen": "^1.9.1",
"esmangle": "^1.0.1", "esmangle": "^1.0.1",
"esprima": "^4.0.0", "esprima": "^4.0.0",
"exif-parser": "^0.1.12", "exif-parser": "^0.1.12",
@ -88,13 +88,13 @@
"js-sha3": "^0.7.0", "js-sha3": "^0.7.0",
"jsbn": "^1.1.0", "jsbn": "^1.1.0",
"jsonpath": "^1.0.0", "jsonpath": "^1.0.0",
"jsrsasign": "8.0.4", "jsrsasign": "8.0.6",
"lodash": "^4.17.4", "lodash": "^4.17.5",
"loglevel": "^1.6.1", "loglevel": "^1.6.1",
"loglevel-message-prefix": "^3.0.0", "loglevel-message-prefix": "^3.0.0",
"moment": "^2.20.1", "moment": "^2.20.1",
"moment-timezone": "^0.5.14", "moment-timezone": "^0.5.14",
"node-forge": "^0.7.1", "node-forge": "^0.7.2",
"node-md6": "^0.1.0", "node-md6": "^0.1.0",
"nwmatcher": "^1.4.3", "nwmatcher": "^1.4.3",
"otp": "^0.1.3", "otp": "^0.1.3",
@ -106,7 +106,7 @@
"vkbeautify": "^0.99.3", "vkbeautify": "^0.99.3",
"xmldom": "^0.1.27", "xmldom": "^0.1.27",
"xpath": "0.0.27", "xpath": "0.0.27",
"xregexp": "^4.0.0", "xregexp": "^4.1.1",
"zlibjs": "^0.3.1" "zlibjs": "^0.3.1"
}, },
"scripts": { "scripts": {

View File

@ -3181,7 +3181,7 @@ const OperationConfig = {
outputType: "string", outputType: "string",
args: [ args: [
{ {
name: "Password", name: "Key",
type: "binaryString", type: "binaryString",
value: "" value: ""
}, },

View File

@ -1,5 +1,5 @@
import Utils from "../Utils.js"; import Utils from "../Utils.js";
import CryptoApi from "crypto-api"; import CryptoApi from "babel-loader!crypto-api";
import MD6 from "node-md6"; import MD6 from "node-md6";
import * as SHA3 from "js-sha3"; import * as SHA3 from "js-sha3";
import Checksum from "./Checksum.js"; import Checksum from "./Checksum.js";
@ -21,14 +21,11 @@ const Hash = {
* *
* @param {string} name * @param {string} name
* @param {string} input * @param {string} input
* @para, {Object} [options={}]
* @returns {string} * @returns {string}
*/ */
runHash: function(name, input) { runHash: function(name, input, options={}) {
const hasher = CryptoApi.hasher(name); return CryptoApi.hash(name, input, options);
hasher.state.message = input;
hasher.state.length += input.length;
hasher.process();
return hasher.finalize().stringify("hex");
}, },
@ -329,9 +326,10 @@ const Hash = {
* @returns {string} * @returns {string}
*/ */
runSnefru: function (input, args) { runSnefru: function (input, args) {
const rounds = args[0], return Hash.runHash("snefru", input, {
size = args[1]; rounds: args[0],
return Hash.runHash(`snefru-${rounds}-${size}`, input); length: args[1]
});
}, },
@ -358,7 +356,8 @@ const Hash = {
"HAS160", "HAS160",
"Whirlpool", "Whirlpool",
"Whirlpool-0", "Whirlpool-0",
"Whirlpool-T" "Whirlpool-T",
"Snefru"
], ],
/** /**
@ -369,12 +368,17 @@ const Hash = {
* @returns {string} * @returns {string}
*/ */
runHMAC: function (input, args) { runHMAC: function (input, args) {
const password = args[0], const key = args[0],
hashFunc = args[1].toLowerCase(), hashFunc = args[1].toLowerCase();
hmac = CryptoApi.mac("hmac", password, hashFunc, {}); let hasher = CryptoApi.getHasher(hashFunc);
hmac.update(input); // Horrible shim to fix constructor bug. Reported in nf404/crypto-api#8
return hmac.finalize().stringify("hex"); hasher.reset = () => {
hasher.state = {};
const tmp = new hasher.constructor();
hasher.state = tmp.state;
};
return CryptoApi.hmac(key, input, hasher);
}, },

View File

@ -109,9 +109,13 @@ module.exports = {
children: false, children: false,
chunks: false, chunks: false,
modules: false, modules: false,
entrypoints: false,
warningsFilter: /source-map/, warningsFilter: /source-map/,
}, },
node: { node: {
fs: "empty" fs: "empty"
},
performance: {
hints: false
} }
}; };