mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 16:56:15 -04:00
Merge branch 'master' of https://github.com/gchq/CyberChef into feature/advanced-entropy
This commit is contained in:
commit
daee7ac761
8 changed files with 1036 additions and 613 deletions
|
@ -836,7 +836,7 @@ class Utils {
|
|||
args = m[2]
|
||||
.replace(/"/g, '\\"') // Escape double quotes
|
||||
.replace(/(^|,|{|:)'/g, '$1"') // Replace opening ' with "
|
||||
.replace(/([^\\]|[^\\]\\\\)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||
.replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g, '$1"$2') // Replace closing ' with "
|
||||
.replace(/\\'/g, "'"); // Unescape single quotes
|
||||
args = "[" + args + "]";
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ class AESEncrypt extends Operation {
|
|||
* @throws {OperationError} if invalid key length
|
||||
*/
|
||||
run(input, args) {
|
||||
const key = Utils.convertToByteArray(args[0].string, args[0].option),
|
||||
iv = Utils.convertToByteArray(args[1].string, args[1].option),
|
||||
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
||||
iv = Utils.convertToByteString(args[1].string, args[1].option),
|
||||
mode = args[2],
|
||||
inputType = args[3],
|
||||
outputType = args[4];
|
||||
|
|
|
@ -108,7 +108,7 @@ class App {
|
|||
handleError(err, logToConsole) {
|
||||
if (logToConsole) log.error(err);
|
||||
const msg = err.displayStr || err.toString();
|
||||
this.alert(msg, this.options.errorTimeout, !this.options.showErrors);
|
||||
this.alert(Utils.escapeHtml(msg), this.options.errorTimeout, !this.options.showErrors);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -293,7 +293,9 @@ class HTMLIngredient {
|
|||
const op = el.parentNode.parentNode;
|
||||
const target = op.querySelectorAll(".arg")[this.target];
|
||||
|
||||
target.value = el.childNodes[el.selectedIndex].getAttribute("populate-value");
|
||||
const popVal = el.childNodes[el.selectedIndex].getAttribute("populate-value");
|
||||
if (popVal !== "") target.value = popVal;
|
||||
|
||||
const evt = new Event("change");
|
||||
target.dispatchEvent(evt);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue