cyberchef 9.50.6 → 9.50.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyberchef",
3
- "version": "9.50.6",
3
+ "version": "9.50.8",
4
4
  "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
5
5
  "author": "n1474335 <n1474335@gmail.com>",
6
6
  "homepage": "https://gchq.github.io/CyberChef",
@@ -6925,7 +6925,7 @@
6925
6925
  {
6926
6926
  "name": "Margin (num modules)",
6927
6927
  "type": "number",
6928
- "value": 2,
6928
+ "value": 4,
6929
6929
  "min": 0
6930
6930
  },
6931
6931
  {
@@ -44,7 +44,7 @@ class GenerateQRCode extends Operation {
44
44
  {
45
45
  "name": "Margin (num modules)",
46
46
  "type": "number",
47
- "value": 2,
47
+ "value": 4,
48
48
  "min": 0
49
49
  },
50
50
  {
@@ -57,23 +57,29 @@ class ParseX509Certificate extends Operation {
57
57
  const cert = new r.X509(),
58
58
  inputFormat = args[0];
59
59
 
60
- switch (inputFormat) {
61
- case "DER Hex":
62
- input = input.replace(/\s/g, "").toLowerCase();
63
- cert.readCertHex(input);
64
- break;
65
- case "PEM":
66
- cert.readCertPEM(input);
67
- break;
68
- case "Base64":
69
- cert.readCertHex(toHex(fromBase64(input, null, "byteArray"), ""));
70
- break;
71
- case "Raw":
72
- cert.readCertHex(toHex(Utils.strToByteArray(input), ""));
73
- break;
74
- default:
75
- throw "Undefined input format";
60
+ let undefinedInputFormat = false;
61
+ try {
62
+ switch (inputFormat) {
63
+ case "DER Hex":
64
+ input = input.replace(/\s/g, "").toLowerCase();
65
+ cert.readCertHex(input);
66
+ break;
67
+ case "PEM":
68
+ cert.readCertPEM(input);
69
+ break;
70
+ case "Base64":
71
+ cert.readCertHex(toHex(fromBase64(input, null, "byteArray"), ""));
72
+ break;
73
+ case "Raw":
74
+ cert.readCertHex(toHex(Utils.strToByteArray(input), ""));
75
+ break;
76
+ default:
77
+ undefinedInputFormat = true;
78
+ }
79
+ } catch (e) {
80
+ throw "Certificate load error (non-certificate input?)";
76
81
  }
82
+ if (undefinedInputFormat) throw "Undefined input format";
77
83
 
78
84
  const sn = cert.getSerialNumberHex(),
79
85
  issuer = cert.getIssuer(),