Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH agent keys get removed even when other databases are closed #4532

Closed
snstamml opened this issue Apr 1, 2020 · 2 comments · Fixed by #4545
Closed

SSH agent keys get removed even when other databases are closed #4532

snstamml opened this issue Apr 1, 2020 · 2 comments · Fixed by #4545
Assignees

Comments

@snstamml
Copy link

snstamml commented Apr 1, 2020

Expected Behavior

SSH agent keys from databases B, C, D... should not be removed from the key agent when database A is closed. Only keys from database A should be removed.

Current Behavior

When closing database A, SSH agent keys from database B (or any other database) registered with the key agent are removed.

Possible Solution

Check from which database an agent key derives from, and remove only those that come from the database that is being closed.

Steps to Reproduce

  1. Create and open databases A and B
  2. Create an entry in database B with a "SSH Agent" key and click "Add to agent"
  3. Check the key list in the SSH agent (e.g. Pageant on Windows)
  4. Close database A
  5. Check the key list in the SSH agent

Context

Every time any database is closed, all keys from the other databases need to be manually re-added to the key agent.

Debug Info

KeePassXC - Version 2.5.3
Revision: f8c962b

Qt 5.13.2
Debugging mode is disabled.

Operating system: Windows 10 (10.0)
CPU architecture: x86_64
Kernel: winnt 10.0.18363

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (signed and unsigned sharing)
  • YubiKey

Cryptographic libraries:
libgcrypt 1.8.5

@hifi
Copy link
Member

hifi commented Apr 2, 2020

We don't currently track the database a key was added from which causes this issue.

It either needs to be "hacked" in as an extra argument to SSHAgent::addIdentity or a more creative solution be figured out. I don't like changing the API just to have an extra argument for this purpose but it may be an interim solution.

Whatever the final solution is the corner case of not having a database when adding a key (however unlikely) needs to be accounted for.

@droidmonkey
Copy link
Member

Recommend tying it to the Database UUID.

hifi added a commit to hifi/keepassxc that referenced this issue Apr 4, 2020
hifi added a commit to hifi/keepassxc that referenced this issue Apr 4, 2020
hifi added a commit to hifi/keepassxc that referenced this issue May 3, 2020
hifi added a commit to hifi/keepassxc that referenced this issue May 3, 2020
hifi added a commit to hifi/keepassxc that referenced this issue May 15, 2020
hifi added a commit to hifi/keepassxc that referenced this issue May 17, 2020
hifi added a commit to hifi/keepassxc that referenced this issue May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants