Rename SymEncryptedAEADProtectedDataPacket to AEADEncryptedDataPacket
This commit is contained in:
parent
17fc32ba51
commit
6a607c7567
|
@ -206,7 +206,7 @@ export default {
|
|||
userAttribute: 17,
|
||||
symEncryptedIntegrityProtectedData: 18,
|
||||
modificationDetectionCode: 19,
|
||||
symEncryptedAEADProtectedData: 20 // see IETF draft: https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1
|
||||
AEADEncryptedData: 20 // see IETF draft: https://tools.ietf.org/html/draft-ford-openpgp-format-00#section-2.1
|
||||
},
|
||||
|
||||
/** Data types in the literal packet
|
||||
|
|
|
@ -40,7 +40,7 @@ import {
|
|||
PacketList,
|
||||
LiteralDataPacket,
|
||||
CompressedDataPacket,
|
||||
SymEncryptedAEADProtectedDataPacket,
|
||||
AEADEncryptedDataPacket,
|
||||
SymEncryptedIntegrityProtectedDataPacket,
|
||||
SymmetricallyEncryptedDataPacket,
|
||||
PublicKeyEncryptedSessionKeyPacket,
|
||||
|
@ -115,7 +115,7 @@ export class Message {
|
|||
const symEncryptedPacketlist = this.packets.filterByTag(
|
||||
enums.packet.symmetricallyEncryptedData,
|
||||
enums.packet.symEncryptedIntegrityProtectedData,
|
||||
enums.packet.symEncryptedAEADProtectedData
|
||||
enums.packet.AEADEncryptedData
|
||||
);
|
||||
|
||||
if (symEncryptedPacketlist.length === 0) {
|
||||
|
@ -333,7 +333,7 @@ export class Message {
|
|||
|
||||
let symEncryptedPacket;
|
||||
if (aeadAlgorithm) {
|
||||
symEncryptedPacket = new SymEncryptedAEADProtectedDataPacket();
|
||||
symEncryptedPacket = new AEADEncryptedDataPacket();
|
||||
symEncryptedPacket.aeadAlgorithm = aeadAlgorithm;
|
||||
} else if (config.integrityProtect) {
|
||||
symEncryptedPacket = new SymEncryptedIntegrityProtectedDataPacket();
|
||||
|
@ -780,7 +780,7 @@ export async function read(input, fromStream = util.isStream(input)) {
|
|||
await packetlist.read(input, {
|
||||
LiteralDataPacket,
|
||||
CompressedDataPacket,
|
||||
SymEncryptedAEADProtectedDataPacket,
|
||||
AEADEncryptedDataPacket,
|
||||
SymEncryptedIntegrityProtectedDataPacket,
|
||||
SymmetricallyEncryptedDataPacket,
|
||||
PublicKeyEncryptedSessionKeyPacket,
|
||||
|
|
|
@ -46,9 +46,9 @@ const VERSION = 1; // A one-octet version number of the data packet.
|
|||
* AEAD Protected Data Packet
|
||||
* @memberof module:packet
|
||||
*/
|
||||
class SymEncryptedAEADProtectedDataPacket {
|
||||
class AEADEncryptedDataPacket {
|
||||
constructor() {
|
||||
this.tag = enums.packet.symEncryptedAEADProtectedData;
|
||||
this.tag = enums.packet.AEADEncryptedData;
|
||||
this.version = VERSION;
|
||||
this.cipherAlgo = null;
|
||||
this.aeadAlgorithm = 'eax';
|
||||
|
@ -199,4 +199,4 @@ class SymEncryptedAEADProtectedDataPacket {
|
|||
}
|
||||
}
|
||||
|
||||
export default SymEncryptedAEADProtectedDataPacket;
|
||||
export default AEADEncryptedDataPacket;
|
|
@ -13,9 +13,9 @@ export {
|
|||
default as SymEncryptedIntegrityProtectedDataPacket
|
||||
} from './sym_encrypted_integrity_protected_data.js';
|
||||
export {
|
||||
/** @see SymEncryptedAEADProtectedDataPacket */
|
||||
default as SymEncryptedAEADProtectedDataPacket
|
||||
} from './sym_encrypted_aead_protected_data.js';
|
||||
/** @see AEADEncryptedDataPacket */
|
||||
default as AEADEncryptedDataPacket
|
||||
} from './aead_encrypted_data.js';
|
||||
export {
|
||||
/** @see PublicKeyEncryptedSessionKeyPacket */
|
||||
default as PublicKeyEncryptedSessionKeyPacket
|
||||
|
|
|
@ -109,7 +109,7 @@ export default {
|
|||
enums.packet.compressedData,
|
||||
enums.packet.symmetricallyEncryptedData,
|
||||
enums.packet.symEncryptedIntegrityProtectedData,
|
||||
enums.packet.symEncryptedAEADProtectedData
|
||||
enums.packet.AEADEncryptedData
|
||||
].includes(tag_type);
|
||||
},
|
||||
|
||||
|
|
|
@ -1080,7 +1080,7 @@ module.exports = () => describe('OpenPGP.js public api tests', function() {
|
|||
return openpgp.encrypt(encOpt).then(async function (encrypted) {
|
||||
expect(encrypted).to.match(/^-----BEGIN PGP MESSAGE/);
|
||||
decOpt.message = await openpgp.message.readArmored(encrypted);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.symEncryptedAEADProtectedData)).to.equal(false);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.AEADEncryptedData)).to.equal(false);
|
||||
return openpgp.decrypt(decOpt);
|
||||
}).then(function (decrypted) {
|
||||
expect(decrypted.data).to.equal(plaintext);
|
||||
|
@ -1103,7 +1103,7 @@ module.exports = () => describe('OpenPGP.js public api tests', function() {
|
|||
return openpgp.encrypt(encOpt).then(async function (encrypted) {
|
||||
expect(encrypted).to.match(/^-----BEGIN PGP MESSAGE/);
|
||||
decOpt.message = await openpgp.message.readArmored(encrypted);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.symEncryptedAEADProtectedData)).to.equal(false);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.AEADEncryptedData)).to.equal(false);
|
||||
return openpgp.decrypt(decOpt);
|
||||
}).then(function (decrypted) {
|
||||
expect(decrypted.data).to.equal(plaintext);
|
||||
|
@ -1122,7 +1122,7 @@ module.exports = () => describe('OpenPGP.js public api tests', function() {
|
|||
};
|
||||
return openpgp.encrypt(encOpt).then(async function (encrypted) {
|
||||
decOpt.message = await openpgp.message.readArmored(encrypted);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.symEncryptedAEADProtectedData)).to.equal(openpgp.config.aeadProtect);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.AEADEncryptedData)).to.equal(openpgp.config.aeadProtect);
|
||||
return openpgp.decrypt(decOpt);
|
||||
}).then(async function (decrypted) {
|
||||
expect(decrypted.data).to.equal(plaintext);
|
||||
|
@ -1145,7 +1145,7 @@ module.exports = () => describe('OpenPGP.js public api tests', function() {
|
|||
};
|
||||
return openpgp.encrypt(encOpt).then(async function (encrypted) {
|
||||
decOpt.message = await openpgp.message.readArmored(encrypted);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.symEncryptedAEADProtectedData)).to.equal(false);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.AEADEncryptedData)).to.equal(false);
|
||||
return openpgp.decrypt(decOpt);
|
||||
}).then(async function (decrypted) {
|
||||
expect(decrypted.data).to.equal(plaintext);
|
||||
|
@ -1176,7 +1176,7 @@ module.exports = () => describe('OpenPGP.js public api tests', function() {
|
|||
};
|
||||
return openpgp.encrypt(encOpt).then(async function (encrypted) {
|
||||
decOpt.message = await openpgp.message.readArmored(encrypted);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.symEncryptedAEADProtectedData)).to.equal(openpgp.config.aeadProtect);
|
||||
expect(!!decOpt.message.packets.findPacket(openpgp.enums.packet.AEADEncryptedData)).to.equal(openpgp.config.aeadProtect);
|
||||
return openpgp.decrypt(decOpt);
|
||||
}).then(async function (decrypted) {
|
||||
expect(decrypted.data).to.equal(plaintext);
|
||||
|
@ -1205,7 +1205,7 @@ module.exports = () => describe('OpenPGP.js public api tests', function() {
|
|||
detached: true
|
||||
});
|
||||
const message = await openpgp.message.readArmored(encrypted);
|
||||
expect(!!message.packets.findPacket(openpgp.enums.packet.symEncryptedAEADProtectedData)).to.equal(openpgp.config.aeadProtect);
|
||||
expect(!!message.packets.findPacket(openpgp.enums.packet.AEADEncryptedData)).to.equal(openpgp.config.aeadProtect);
|
||||
const decrypted = await openpgp.decrypt({
|
||||
message,
|
||||
signature: await openpgp.signature.readArmored(signed),
|
||||
|
|
|
@ -133,7 +133,7 @@ module.exports = () => describe("Packet", function() {
|
|||
const algo = 'aes256';
|
||||
const testText = input.createSomeMessage();
|
||||
const literal = new openpgp.LiteralDataPacket();
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
|
||||
msg.push(enc);
|
||||
|
@ -159,7 +159,7 @@ module.exports = () => describe("Packet", function() {
|
|||
const algo = 'aes256';
|
||||
|
||||
const literal = new openpgp.LiteralDataPacket();
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
|
||||
msg.push(enc);
|
||||
|
@ -214,7 +214,7 @@ module.exports = () => describe("Packet", function() {
|
|||
const algo = 'aes256';
|
||||
|
||||
const literal = new openpgp.LiteralDataPacket();
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
enc.aeadAlgorithm = 'experimentalGcm';
|
||||
|
||||
|
@ -260,7 +260,7 @@ module.exports = () => describe("Packet", function() {
|
|||
const algo = 'aes128';
|
||||
|
||||
const literal = new openpgp.LiteralDataPacket(0);
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
|
||||
msg.push(enc);
|
||||
|
@ -497,7 +497,7 @@ module.exports = () => describe("Packet", function() {
|
|||
|
||||
const literal = new openpgp.LiteralDataPacket();
|
||||
const key_enc = new openpgp.SymEncryptedSessionKeyPacket();
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
|
||||
msg.push(key_enc);
|
||||
|
@ -565,7 +565,7 @@ module.exports = () => describe("Packet", function() {
|
|||
|
||||
const literal = new openpgp.LiteralDataPacket(0);
|
||||
const key_enc = new openpgp.SymEncryptedSessionKeyPacket();
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
|
||||
msg.push(key_enc);
|
||||
|
@ -640,7 +640,7 @@ module.exports = () => describe("Packet", function() {
|
|||
|
||||
const literal = new openpgp.LiteralDataPacket(0);
|
||||
const key_enc = new openpgp.SymEncryptedSessionKeyPacket();
|
||||
const enc = new openpgp.SymEncryptedAEADProtectedDataPacket();
|
||||
const enc = new openpgp.AEADEncryptedDataPacket();
|
||||
const msg = new openpgp.PacketList();
|
||||
enc.aeadAlgorithm = key_enc.aeadAlgorithm = 'ocb';
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user