From c8569e0cd5d6d96dab8b59faf972d144c57c8e03 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 24 Mar 2016 10:52:34 +0800 Subject: [PATCH] Add version attribute to the AEAD packet --- src/packet/sym_encrypted_aead_protected.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packet/sym_encrypted_aead_protected.js b/src/packet/sym_encrypted_aead_protected.js index 36dcfb05..41f44aec 100644 --- a/src/packet/sym_encrypted_aead_protected.js +++ b/src/packet/sym_encrypted_aead_protected.js @@ -34,6 +34,7 @@ const IV_LEN = crypto.gcm.ivLength; // currently only AES-GCM is supported */ export default function SymEncryptedAEADProtected() { this.tag = enums.packet.symEncryptedAEADProtected; + this.version = VERSION; this.iv = null; this.encrypted = null; this.packets = null; @@ -58,7 +59,7 @@ SymEncryptedAEADProtected.prototype.read = function (bytes) { * @return {Uint8Array} The encrypted payload */ SymEncryptedAEADProtected.prototype.write = function () { - return util.concatUint8Array([new Uint8Array([VERSION]), this.iv, this.encrypted]); + return util.concatUint8Array([new Uint8Array([this.version]), this.iv, this.encrypted]); }; /**