GODT-2081: if keychain cannot be loaded do not wipe Vault and use a temp one.

This commit is contained in:
Romain LE JEUNE
2022-11-17 15:47:24 +01:00
parent 515a8689e9
commit 50da1e4704

View File

@ -20,6 +20,7 @@ package app
import (
"encoding/base64"
"fmt"
"path"
"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/ProtonMail/proton-bridge/v2/internal/certs"
@ -80,6 +81,9 @@ func newVault(locations *locations.Locations) (*vault.Vault, bool, bool, error)
if key, err := getVaultKey(vaultDir); err != nil {
insecure = true
// We store the insecure vault in a separate directory
vaultDir = path.Join(vaultDir, "insecure")
} else {
vaultKey = key
}