Clear KeePassGO master password after use

This commit is contained in:
Joe Julian
2026-03-29 15:38:30 -07:00
parent 75002a4c47
commit 72b413a11a
2 changed files with 46 additions and 0 deletions
+10
View File
@@ -428,6 +428,7 @@ func (u *ui) setMasterKeyMode(vault.MasterKeyMode) {}
func (u *ui) createVaultAction() error {
key, err := u.currentMasterKey()
defer u.clearMasterPassword()
if err != nil {
return err
}
@@ -449,6 +450,7 @@ func (u *ui) createVaultAction() error {
func (u *ui) openVaultAction() error {
key, err := u.currentMasterKey()
defer u.clearMasterPassword()
if err != nil {
return err
}
@@ -488,6 +490,7 @@ func (u *ui) saveAsAction() error {
func (u *ui) openRemoteAction() error {
key, err := u.currentMasterKey()
defer u.clearMasterPassword()
if err != nil {
return err
}
@@ -506,6 +509,7 @@ func (u *ui) openRemoteAction() error {
}
func (u *ui) lockAction() error {
u.clearMasterPassword()
if err := u.state.Lock(); err != nil {
return err
}
@@ -518,6 +522,7 @@ func (u *ui) lockAction() error {
func (u *ui) unlockAction() error {
key, err := u.currentMasterKey()
defer u.clearMasterPassword()
if err != nil {
return err
}
@@ -532,12 +537,17 @@ func (u *ui) unlockAction() error {
func (u *ui) changeMasterKeyAction() error {
key, err := u.currentMasterKey()
defer u.clearMasterPassword()
if err != nil {
return err
}
return u.state.ChangeMasterKey(key)
}
func (u *ui) clearMasterPassword() {
u.masterPassword.SetText("")
}
func (u *ui) synchronizeAction() error {
if err := u.state.Synchronize(); err != nil {
return err