mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-06 22:47:11 -04:00
Remove "display message in output" opt in PGP ops
This commit is contained in:
parent
56154a7987
commit
4c6866286b
3 changed files with 8 additions and 101 deletions
|
@ -3223,11 +3223,6 @@ var OperationConfig = {
|
|||
type: "string",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "Display message in output",
|
||||
type: "boolean",
|
||||
value: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
"Sign PGP Detached": {
|
||||
|
@ -3264,11 +3259,6 @@ var OperationConfig = {
|
|||
type: "text",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "Display message in output",
|
||||
type: "boolean",
|
||||
value: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
"Sign PGP Cleartext": {
|
||||
|
@ -3300,11 +3290,6 @@ var OperationConfig = {
|
|||
type: "text",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "Display message in output",
|
||||
type: "boolean",
|
||||
value: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
"Generate PGP Key Pair": {
|
||||
|
|
|
@ -171,8 +171,7 @@ var PGP = {
|
|||
runVerify: function (input, args) {
|
||||
var publicKey = args[0],
|
||||
privateKey = args[1],
|
||||
password = args[2],
|
||||
displayDecrypt = args[3];
|
||||
password = args[2];
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
try {
|
||||
|
@ -229,7 +228,7 @@ var PGP = {
|
|||
"Signed by: " + verification.author,
|
||||
"Signed with: ",
|
||||
"\n",
|
||||
displayDecrypt && verification.verified ? decrypted.data : "",
|
||||
decrypted.data,
|
||||
].join("\n"));
|
||||
|
||||
})
|
||||
|
@ -316,8 +315,7 @@ var PGP = {
|
|||
*/
|
||||
runVerifyDetached: function (input, args) {
|
||||
var publicKey = args[0],
|
||||
armoredSignature = args[1],
|
||||
displayDecrypt = args[2];
|
||||
armoredSignature = args[1];
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
try {
|
||||
|
@ -358,7 +356,7 @@ var PGP = {
|
|||
"Signed by: " + verification.author,
|
||||
"Signed with: ",
|
||||
"\n",
|
||||
displayDecrypt && verification.verified ? input : "",
|
||||
input,
|
||||
].join("\n"));
|
||||
|
||||
})
|
||||
|
@ -419,8 +417,7 @@ var PGP = {
|
|||
* @returns {string} - "true" or "false" depending on the validity of the signature
|
||||
*/
|
||||
runVerifyCleartext: function (input, args) {
|
||||
var publicKey = args[0],
|
||||
displayDecrypt = args[1];
|
||||
var publicKey = args[0];
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
|
@ -463,7 +460,7 @@ var PGP = {
|
|||
"Signed by: " + verification.author,
|
||||
"Signed with: ",
|
||||
"\n",
|
||||
displayDecrypt && verification.verified ? verification.message : "",
|
||||
verification.message,
|
||||
].join("\n"));
|
||||
})
|
||||
.catch(function(err) {
|
||||
|
|
|
@ -317,47 +317,7 @@ TestRegister.addTests([{
|
|||
},
|
||||
{
|
||||
op: "PGP Verify",
|
||||
args: [alice.pub, bob.sec, bob.password, true],
|
||||
},
|
||||
],
|
||||
}]);
|
||||
});
|
||||
});
|
||||
|
||||
["hello world"].forEach(function(input) {
|
||||
[
|
||||
[PGP_TEST_KEY_PAIRS[0], PGP_TEST_KEY_PAIRS[1]],
|
||||
[PGP_TEST_KEY_PAIRS[1], PGP_TEST_KEY_PAIRS[0]],
|
||||
].forEach(function(pairOfKeyPairs) {
|
||||
var alice = pairOfKeyPairs[0];
|
||||
var bob = pairOfKeyPairs[1];
|
||||
|
||||
var testName = "PGP Sign ($alice), PGP Verify ($bob) '$input' (message hidden)";
|
||||
testName = testName.replace("$alice", alice.name);
|
||||
testName = testName.replace("$bob", bob.name);
|
||||
testName = testName.replace("$input", input);
|
||||
|
||||
TestRegister.addTests([{
|
||||
name: testName,
|
||||
input: input,
|
||||
expectedOutput: [
|
||||
"Verified: true",
|
||||
"Key ID: " + alice.keyID,
|
||||
"Encrypted for: " + bob.name,
|
||||
"Signed on: ",
|
||||
"Signed by: " + alice.name,
|
||||
"Signed with: ",
|
||||
"\n",
|
||||
"",
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "PGP Sign",
|
||||
args: [bob.pub, alice.sec, alice.password],
|
||||
},
|
||||
{
|
||||
op: "PGP Verify",
|
||||
args: [alice.pub, bob.sec, bob.password, false],
|
||||
args: [alice.pub, bob.sec, bob.password],
|
||||
},
|
||||
],
|
||||
}]);
|
||||
|
@ -391,42 +351,7 @@ TestRegister.addTests([{
|
|||
},
|
||||
{
|
||||
op: "Verify PGP Cleartext",
|
||||
args: [keyPair.pub, true],
|
||||
},
|
||||
],
|
||||
};
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
["", "hello world"].forEach(function(input) {
|
||||
TestRegister.addTests(
|
||||
PGP_TEST_KEY_PAIRS.map(function(keyPair) {
|
||||
var testName = "Sign Sign Cleartext, Verify PGP Cleartext ($pw, $ks) '$input' (message hidden)";
|
||||
testName = testName.replace("$ks", keyPair.size);
|
||||
testName = testName.replace("$pw", keyPair.password ? "pw" : "no pw");
|
||||
testName = testName.replace("$input", input);
|
||||
|
||||
return {
|
||||
name: testName,
|
||||
input: input,
|
||||
expectedOutput: [
|
||||
"Verified: true",
|
||||
"Key ID: " + keyPair.keyID,
|
||||
"Signed on: ",
|
||||
"Signed by: " + keyPair.name,
|
||||
"Signed with: ",
|
||||
"\n",
|
||||
"",
|
||||
].join("\n"),
|
||||
recipeConfig: [
|
||||
{
|
||||
op: "Sign PGP Cleartext",
|
||||
args: [keyPair.sec, keyPair.password],
|
||||
},
|
||||
{
|
||||
op: "Verify PGP Cleartext",
|
||||
args: [keyPair.pub, false],
|
||||
args: [keyPair.pub],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue