desktop: disable os encryption of keystore in portable app

This commit is contained in:
Abdullah Atta
2024-02-26 20:29:23 +05:00
parent c63572abd5
commit 8bf7609d2f
2 changed files with 18 additions and 4 deletions

View File

@@ -392,7 +392,11 @@ class KeyStore extends BaseStore<KeyStore> {
this.#wrappingKeyId
);
if (desktop && !wrappingKey) {
if (
desktop &&
!wrappingKey &&
(await desktop.safeStorage.isEncryptionAvailable.query())
) {
const decrypted = Buffer.from(
await desktop.safeStorage.decryptString.query(
Buffer.from(wrappedKey).toString("base64")
@@ -424,7 +428,11 @@ class KeyStore extends BaseStore<KeyStore> {
["encrypt", "decrypt"]
));
if (IS_DESKTOP_APP && desktop) {
if (
IS_DESKTOP_APP &&
desktop &&
(await desktop.safeStorage.isEncryptionAvailable.query())
) {
const encrypted = Buffer.from(
await desktop.safeStorage.encryptString.query(
Buffer.from(