From e85dfde4d9656f8a65327d53d8ed3f72e29b630a Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Wed, 22 Jan 2025 11:01:27 +0100 Subject: [PATCH] chore(frontend): partially disable storage-manager util (broken and currently not used) --- .../lib/storage-manager/storage-manager.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/src/lib/storage-manager/storage-manager.js b/frontend/src/lib/storage-manager/storage-manager.js index 32008e2ec..3a83a7615 100644 --- a/frontend/src/lib/storage-manager/storage-manager.js +++ b/frontend/src/lib/storage-manager/storage-manager.js @@ -5,7 +5,7 @@ /* global:writable */ import semver from 'semver'; -import sodium from 'sodium-javascript'; +// import sodium from 'sodium-javascript'; import { HttpClient } from '../../services/http-client/http-client'; @@ -499,14 +499,14 @@ function encrypt(plaintext, key) { if (!key) throw new Error('Cannot encrypt plaintext without a valid key!'); // TODO use const if possible - let plaintextB = Buffer.from(plaintext); - let cipherB = Buffer.alloc(plaintextB.length + sodium.crypto_secretbox_MACBYTES); - let nonceB = Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES); - let keyB = Buffer.from(key); + // let plaintextB = Buffer.from(plaintext); + // let cipherB = Buffer.alloc(plaintextB.length + sodium.crypto_secretbox_MACBYTES); + // let nonceB = Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES); + // let keyB = Buffer.from(key); - sodium.crypto_secretbox_easy(cipherB, plaintextB, nonceB, keyB); + // sodium.crypto_secretbox_easy(cipherB, plaintextB, nonceB, keyB); - const result = cipherB; + const result = null; // cipherB; console.log('encrypt result', result); return result; } @@ -519,12 +519,12 @@ function decrypt(ciphertext, key) { if (!key) throw new Error('Cannot decrypt ciphertext without a valid key!'); // TODO use const if possible - let cipherB = Buffer.from(ciphertext); - let plaintextB = undefined; Buffer.alloc(cipherB.length - sodium.crypto_secretbox_MACBYTES); - let nonceB = undefined; Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES); - let keyB = Buffer.from(key); + // let cipherB = Buffer.from(ciphertext); + let plaintextB = null; // Buffer.alloc(cipherB.length - sodium.crypto_secretbox_MACBYTES); + // let nonceB = undefined; Buffer.alloc(sodium.crypto_secretbox_NONCEBYTES); + // let keyB = Buffer.from(key); - sodium.crypto_secretbox_open_easy(plaintextB, cipherB, nonceB, keyB); + // sodium.crypto_secretbox_open_easy(plaintextB, cipherB, nonceB, keyB); const result = plaintextB.toString(); console.log('decrypt result', result);