From bc4d7e86e30c311d3643f1cd753b9fc11de90276 Mon Sep 17 00:00:00 2001 From: toby Date: Wed, 15 Mar 2017 12:43:01 -0400 Subject: [PATCH] Rename PGP "armor" occurrences to "armour" --- src/js/config/Categories.js | 8 ++--- src/js/config/OperationConfig.js | 26 +++++++-------- src/js/operations/PGP.js | 54 ++++++++++++++++---------------- test/tests/operations/PGP.js | 18 +++++------ 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/js/config/Categories.js b/src/js/config/Categories.js index dfa74f29..dabc5d1f 100755 --- a/src/js/config/Categories.js +++ b/src/js/config/Categories.js @@ -102,8 +102,8 @@ var Categories = [ "Verify PGP Cleartext", "Generate PGP Key Pair", "Detach PGP Cleartext", - "Add PGP ASCII Armor", - "Remove PGP ASCII Armor", + "Add PGP ASCII Armour", + "Remove PGP ASCII Armour", ] }, { @@ -125,8 +125,8 @@ var Categories = [ "Verify PGP Cleartext", "Detach PGP Cleartext", "Generate PGP Key Pair", - "Add PGP ASCII Armor", - "Remove PGP ASCII Armor", + "Add PGP ASCII Armour", + "Remove PGP ASCII Armour", ] }, { diff --git a/src/js/config/OperationConfig.js b/src/js/config/OperationConfig.js index bc443289..7e753239 100755 --- a/src/js/config/OperationConfig.js +++ b/src/js/config/OperationConfig.js @@ -3149,7 +3149,7 @@ var OperationConfig = { ] }, "PGP Encrypt": { - description: "Input: An ASCII-Armored PGP public key.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", + description: "Input: An ASCII-Armoured PGP public key.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", run: PGP.runEncrypt, inputType: "string", outputType: "string", @@ -3162,7 +3162,7 @@ var OperationConfig = { ] }, "PGP Decrypt": { - description: "Input: An ASCII-Armored PGP private key (and optionally, the password needed to decrypt the private key).

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", + description: "Input: An ASCII-Armoured PGP private key (and optionally, the password needed to decrypt the private key).

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", run: PGP.runDecrypt, inputType: "string", outputType: "string", @@ -3180,7 +3180,7 @@ var OperationConfig = { ] }, "PGP Sign": { - description: "Input: An ASCII-Armored PGP private key (and optionally, the password needed to decrypt the private key); the public key of the recipient.

This operation uses PGP to produce an encrypted digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", + description: "Input: An ASCII-Armoured PGP private key (and optionally, the password needed to decrypt the private key); the public key of the recipient.

This operation uses PGP to produce an encrypted digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", run: PGP.runSign, inputType: "string", outputType: "string", @@ -3203,7 +3203,7 @@ var OperationConfig = { ] }, "PGP Verify": { - description: "Input: An ASCII-Armored PGP public key.

This operation uses PGP to decrypt and verify an encrypted digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", + description: "Input: An ASCII-Armoured PGP public key.

This operation uses PGP to decrypt and verify an encrypted digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", run: PGP.runVerify, inputType: "string", outputType: "string", @@ -3255,14 +3255,14 @@ var OperationConfig = { value: "", }, { - name: "ASCII armored signature", + name: "ASCII armoured signature", type: "text", value: "", }, ] }, "Sign PGP Cleartext": { - description: "Input: An ASCII-Armored PGP private key (and optionally, the password needed to decrypt the private key).

This operation uses PGP to produce a digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", + description: "Input: An ASCII-Armoured PGP private key (and optionally, the password needed to decrypt the private key).

This operation uses PGP to produce a digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", run: PGP.runSignCleartext, inputType: "string", outputType: "string", @@ -3280,7 +3280,7 @@ var OperationConfig = { ] }, "Verify PGP Cleartext": { - description: "Input: An ASCII-Armored PGP public key.

This operation uses PGP to verify a cleartext digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", + description: "Input: An ASCII-Armoured PGP public key.

This operation uses PGP to verify a cleartext digital signature.

Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.

This function relies on OpenPGP.js for the implementation of PGP.

See more at https://openpgpjs.org/", run: PGP.runVerifyCleartext, inputType: "string", outputType: "string", @@ -3328,22 +3328,22 @@ var OperationConfig = { args: [ ], }, - "Add PGP ASCII Armor": { + "Add PGP ASCII Armour": { description: "", - run: PGP.runAddArmor, + run: PGP.runAddArmour, inputType: "byteArray", outputType: "string", args: [ { - name: "Armor type", + name: "Armour type", type: "option", - value: PGP.ARMOR_TYPES, + value: PGP.ARMOUR_TYPES, }, ], }, - "Remove PGP ASCII Armor": { + "Remove PGP ASCII Armour": { description: "", - run: PGP.runRemoveArmor, + run: PGP.runRemoveArmour, inputType: "string", outputType: "byteArray", args: [ diff --git a/src/js/operations/PGP.js b/src/js/operations/PGP.js index a195fe97..fe7e5c05 100755 --- a/src/js/operations/PGP.js +++ b/src/js/operations/PGP.js @@ -14,7 +14,7 @@ var PGP = { * @constant * @default */ - ARMOR_TYPES: [ + ARMOUR_TYPES: [ "Message", "Public key", "Private key", @@ -25,7 +25,7 @@ var PGP = { * @constant * @default */ - ARMOR_TYPE_MAPPING: { + ARMOUR_TYPE_MAPPING: { "Message": 3, "Public key": 4, "Private key": 5, @@ -240,7 +240,7 @@ var PGP = { /** - * Signs the input using PGP and outputs the plaintext, the raw PGP signature, and the ASCII armored signature files. + * Signs the input using PGP and outputs the plaintext, the raw PGP signature, and the ASCII armoured signature files. * * @param {string} input - data to be signed * @param {Object[]} args @@ -271,15 +271,15 @@ var PGP = { var signature = signedMessage.packets.filterByTag(openpgp.enums.packet.signature); var rawSignatureBytes = signature.write(); - var armoredMessage = openpgp.armor.encode( + var armouredMessage = openpgp.armor.encode( openpgp.enums.armor.message, rawSignatureBytes ); - armoredMessage = armoredMessage.replace( + armouredMessage = armouredMessage.replace( "-----BEGIN PGP MESSAGE-----\r\n", "-----BEGIN PGP SIGNATURE-----\r\n" ); - armoredMessage = armoredMessage.replace( + armouredMessage = armouredMessage.replace( "-----END PGP MESSAGE-----\r\n", "-----END PGP SIGNATURE-----\r\n" ); @@ -291,9 +291,9 @@ var PGP = { bytes: bytes, }, { fileName: "msg.asc", - size: armoredMessage.length, - contents: armoredMessage, - bytes: openpgp.util.str2Uint8Array(armoredMessage), + size: armouredMessage.length, + contents: armouredMessage, + bytes: openpgp.util.str2Uint8Array(armouredMessage), }, { fileName: "msg.sig", size: rawSignatureBytes.length, @@ -315,7 +315,7 @@ var PGP = { */ runVerifyDetached: function (input, args) { var publicKey = args[0], - armoredSignature = args[1]; + armouredSignature = args[1]; return new Promise(function(resolve, reject) { try { @@ -327,10 +327,10 @@ var PGP = { try { var message = openpgp.message.readSignedContent( input, - armoredSignature + armouredSignature ); } catch (err) { - return reject("Could not read armored signature or message: " + err); + return reject("Could not read armoured signature or message: " + err); } @@ -475,7 +475,7 @@ var PGP = { * * @param {string} input is ignored * @param {Object[]} args - * @returns {string} - armored public key and private key separated by whitespace. + * @returns {string} - armoured public key and private key separated by whitespace. */ runGenKeyPair: function (input, args) { var password = args[0], @@ -529,15 +529,15 @@ var PGP = { var signature = message.packets.filterByTag(openpgp.enums.packet.signature); var rawSignatureBytes = signature.write(); - var armoredMessage = openpgp.armor.encode( + var armouredMessage = openpgp.armor.encode( openpgp.enums.armor.message, rawSignatureBytes ); - armoredMessage = armoredMessage.replace( + armouredMessage = armouredMessage.replace( "-----BEGIN PGP MESSAGE-----\r\n", "-----BEGIN PGP SIGNATURE-----\r\n" ); - armoredMessage = armoredMessage.replace( + armouredMessage = armouredMessage.replace( "-----END PGP MESSAGE-----\r\n", "-----END PGP SIGNATURE-----\r\n" ); @@ -549,9 +549,9 @@ var PGP = { bytes: clearbytes, }, { fileName: "msg.asc", - size: armoredMessage.length, - contents: armoredMessage, - bytes: openpgp.util.str2Uint8Array(armoredMessage), + size: armouredMessage.length, + contents: armouredMessage, + bytes: openpgp.util.str2Uint8Array(armouredMessage), }, { fileName: "msg.sig", size: rawSignatureBytes.length, @@ -565,26 +565,26 @@ var PGP = { /** - * Turns raw PGP bytes into an ASCII armored string. + * Turns raw PGP bytes into an ASCII armoured string. * * @param {byteArray} input * @param {Object[]} args - * @returns {string} - armored public key and private key separated by whitespace. + * @returns {string} - armoured public key and private key separated by whitespace. */ - runAddArmor: function (input, args) { - var armorType = PGP.ARMOR_TYPE_MAPPING[args[0]]; - return openpgp.armor.encode(armorType, input); + runAddArmour: function (input, args) { + var armourType = PGP.ARMOUR_TYPE_MAPPING[args[0]]; + return openpgp.armor.encode(armourType, input); }, /** - * Turns an ASCII armored string into raw PGP bytes. + * Turns an ASCII armoured string into raw PGP bytes. * * @param {string} input * @param {Object[]} args - * @returns {byteArray} - armored public key and private key separated by whitespace. + * @returns {byteArray} - armoured public key and private key separated by whitespace. */ - runRemoveArmor: function (input, args) { + runRemoveArmour: function (input, args) { var decoded = openpgp.armor.decode(input); var uint8bytes = decoded.data; var bytes = Array.prototype.slice.call(uint8bytes); diff --git a/test/tests/operations/PGP.js b/test/tests/operations/PGP.js index 4b6cb70a..0ff2fd28 100644 --- a/test/tests/operations/PGP.js +++ b/test/tests/operations/PGP.js @@ -360,7 +360,7 @@ TestRegister.addTests([{ }); TestRegister.addTests(CYBERCHEF_GENERATED_KEY_PAIRS.map(function(keyPair) { - var testName = "Remove PGP ASCII Armor, Add PGP ASCII Armor: Public Key '$name'"; + var testName = "Remove PGP ASCII Armour, Add PGP ASCII Armour: Public Key '$name'"; testName = testName.replace("$name", keyPair.name); return { @@ -370,11 +370,11 @@ TestRegister.addTests(CYBERCHEF_GENERATED_KEY_PAIRS.map(function(keyPair) { ignoreWhitespace: true, recipeConfig: [ { - op: "Remove PGP ASCII Armor", + op: "Remove PGP ASCII Armour", args: [], }, { - op: "Add PGP ASCII Armor", + op: "Add PGP ASCII Armour", args: ["Public key"], }, ], @@ -382,7 +382,7 @@ TestRegister.addTests(CYBERCHEF_GENERATED_KEY_PAIRS.map(function(keyPair) { })); TestRegister.addTests(CYBERCHEF_GENERATED_KEY_PAIRS.map(function(keyPair) { - var testName = "Remove PGP ASCII Armor, Add PGP ASCII Armor: Private Key '$name'"; + var testName = "Remove PGP ASCII Armour, Add PGP ASCII Armour: Private Key '$name'"; testName = testName.replace("$name", keyPair.name); return { @@ -392,11 +392,11 @@ TestRegister.addTests(CYBERCHEF_GENERATED_KEY_PAIRS.map(function(keyPair) { ignoreWhitespace: true, recipeConfig: [ { - op: "Remove PGP ASCII Armor", + op: "Remove PGP ASCII Armour", args: [], }, { - op: "Add PGP ASCII Armor", + op: "Add PGP ASCII Armour", args: ["Private key"], }, ], @@ -406,7 +406,7 @@ TestRegister.addTests(CYBERCHEF_GENERATED_KEY_PAIRS.map(function(keyPair) { PGP_TEST_KEY_PAIRS.forEach(function(keyPair) { TestRegister.addTests( ["", "hello world"].map(function(message, messageIndex) { - var testName = "PGP Encrypt, Remove PGP ASCII Armor, Add PGP ASCII Armor, PGP Decrypt: Message $message '$name'"; + var testName = "PGP Encrypt, Remove PGP ASCII Armour, Add PGP ASCII Armour, PGP Decrypt: Message $message '$name'"; testName = testName.replace("$message", messageIndex); testName = testName.replace("$name", keyPair.name); @@ -421,7 +421,7 @@ PGP_TEST_KEY_PAIRS.forEach(function(keyPair) { args: [keyPair.pub], }, { - op: "Remove PGP ASCII Armor", + op: "Remove PGP ASCII Armour", args: [], }, { @@ -433,7 +433,7 @@ PGP_TEST_KEY_PAIRS.forEach(function(keyPair) { args: ["None"], }, { - op: "Add PGP ASCII Armor", + op: "Add PGP ASCII Armour", args: ["Message"], }, {