From 9cc177a9ad3254acfadef908aeb5121800ef5df9 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Mon, 28 Mar 2022 15:56:15 +0100 Subject: [PATCH] Code quality improvements --- README.md | 1 - src/core/Utils.mjs | 3 ++- src/core/operations/DeriveEVPKey.mjs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 60151523..07257ede 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![](https://github.com/gchq/CyberChef/workflows/Master%20Build,%20Test%20&%20Deploy/badge.svg)](https://github.com/gchq/CyberChef/actions?query=workflow%3A%22Master+Build%2C+Test+%26+Deploy%22) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/gchq/CyberChef.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/gchq/CyberChef/context:javascript) -[![dependencies Status](https://david-dm.org/gchq/CyberChef/status.svg)](https://david-dm.org/gchq/CyberChef) [![npm](https://img.shields.io/npm/v/cyberchef.svg)](https://www.npmjs.com/package/cyberchef) [![](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/gchq/CyberChef/blob/master/LICENSE) [![Gitter](https://badges.gitter.im/gchq/CyberChef.svg)](https://gitter.im/gchq/CyberChef?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index ed29ceba..331a0446 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -723,7 +723,8 @@ class Utils { } if (removeScriptAndStyle) { - htmlStr = recursiveRemove(/<(script|style)[^>]*>.*?<\/(script|style)>/gi, htmlStr); + htmlStr = recursiveRemove(/]*>.*?<\/script>/gi, htmlStr); + htmlStr = recursiveRemove(/]*>.*?<\/style>/gi, htmlStr); } return htmlStr.replace(/<[^>]+>/g, ""); } diff --git a/src/core/operations/DeriveEVPKey.mjs b/src/core/operations/DeriveEVPKey.mjs index b729d6ea..5885f892 100644 --- a/src/core/operations/DeriveEVPKey.mjs +++ b/src/core/operations/DeriveEVPKey.mjs @@ -67,7 +67,7 @@ class DeriveEVPKey extends Operation { iterations = args[2], hasher = args[3], salt = Utils.convertToByteString(args[4].string, args[4].option), - key = CryptoJS.EvpKDF(passphrase, salt, { + key = CryptoJS.EvpKDF(passphrase, salt, { // lgtm [js/insufficient-password-hash] keySize: keySize, hasher: CryptoJS.algo[hasher], iterations: iterations,