From 9fd39ab57f46795a235e7cb3aa36f3c22721271e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 18 Sep 2020 12:04:48 +0200 Subject: [PATCH] aes-js doesn't work with ArrayBuffers --- src/ui/web/dom/CryptoDriver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/web/dom/CryptoDriver.js b/src/ui/web/dom/CryptoDriver.js index 1f856000..66bb35c0 100644 --- a/src/ui/web/dom/CryptoDriver.js +++ b/src/ui/web/dom/CryptoDriver.js @@ -209,8 +209,8 @@ class CryptoLegacyAESDriver { */ async decrypt(key, iv, ciphertext) { const aesjs = this._aesjs; - var aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(iv)); - return aesCtr.decrypt(ciphertext); + var aesCtr = new aesjs.ModeOfOperation.ctr(new Uint8Array(key), new aesjs.Counter(new Uint8Array(iv))); + return aesCtr.decrypt(new Uint8Array(ciphertext)); } }