Fix symmetric crypto key spelling

This commit is contained in:
Bernd Schoolmann 2024-04-28 17:21:33 +02:00
parent d67bc68c25
commit 4d43e6f133
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View File

@ -64,17 +64,17 @@ func sync(ctx context.Context, vault *vault.Vault, cfg *config.Config) bool {
return false return false
} }
var protectedUserSymetricKey crypto.SymmetricEncryptionKey var protectedUserSymmetricKey crypto.SymmetricEncryptionKey
if vault.Keyring.IsMemguard { if vault.Keyring.IsMemguard {
protectedUserSymetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(userSymmetricKey) protectedUserSymmetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(userSymmetricKey)
} else { } else {
protectedUserSymetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(userSymmetricKey) protectedUserSymmetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(userSymmetricKey)
} }
if err != nil { if err != nil {
return false return false
} }
err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymetricKey, true) err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymmetricKey, true)
if err != nil { if err != nil {
return false return false
} }

View File

@ -106,11 +106,11 @@ func handleLogin(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vault
err = cfg.SetUserSymmetricKey(vault.Keyring.GetAccountKey().Bytes()) err = cfg.SetUserSymmetricKey(vault.Keyring.GetAccountKey().Bytes())
err = cfg.SetMasterPasswordHash([]byte(masterpasswordHash)) err = cfg.SetMasterPasswordHash([]byte(masterpasswordHash))
err = cfg.SetMasterKey([]byte(masterKey.GetBytes())) err = cfg.SetMasterKey([]byte(masterKey.GetBytes()))
var protectedUserSymetricKey crypto.SymmetricEncryptionKey var protectedUserSymmetricKey crypto.SymmetricEncryptionKey
if vault.Keyring.IsMemguard { if vault.Keyring.IsMemguard {
protectedUserSymetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes()) protectedUserSymmetricKey, err = crypto.MemguardSymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes())
} else { } else {
protectedUserSymetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes()) protectedUserSymmetricKey, err = crypto.MemorySymmetricEncryptionKeyFromBytes(vault.Keyring.GetAccountKey().Bytes())
} }
if err != nil { if err != nil {
defer func() { defer func() {
@ -129,7 +129,7 @@ func handleLogin(msg messages.IPCMessage, cfg *config.Config, vault *vault.Vault
} }
return return
} }
err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymetricKey, false) err = bitwarden.DoFullSync(context.WithValue(ctx, bitwarden.AuthToken{}, token.AccessToken), vault, cfg, &protectedUserSymmetricKey, false)
response, err = messages.IPCMessageFromPayload(messages.ActionResponse{ response, err = messages.IPCMessageFromPayload(messages.ActionResponse{
Success: true, Success: true,