Skip to content

Add SSH Key support in Bitwarden Importer#13107

Open
chmod222 wants to merge 4 commits intokeepassxreboot:developfrom
chmod222:feature/bitwarden-ssh-key
Open

Add SSH Key support in Bitwarden Importer#13107
chmod222 wants to merge 4 commits intokeepassxreboot:developfrom
chmod222:feature/bitwarden-ssh-key

Conversation

@chmod222
Copy link

@chmod222 chmod222 commented Mar 5, 2026

Fixes/Implements #12778 by adding support for SSH-Key attributes in Bitwarden JSON imports.

If an entry that contains an SSH-Key attribute is imported, the importer code turns it into two attachment files for the public and private key parts, with some light attempt at naming them somewhat sensibly being done. If no key type can be determined, fall back on the default names of "id" and "id.pub".

An open point I would still like to solve is marking the imported key as the default private key for the SSH Agent, but I would need to familiarize myself with the code base a bit more before. Any pointers are of course welcome.

(No generative AI was used in the creation of this code)
(It's been a while since I wrote Qt/C++ in anger, feel free to critique the heck out of my code style)

Testing strategy

  • Tested manually using exports from a Bitwarden database
  • 2 Unit tests for RSA and Ed25519 keys

Type of change

  • ✅ New feature (change that adds functionality)

@chmod222 chmod222 marked this pull request as ready for review March 5, 2026 01:02
@chmod222 chmod222 changed the title Add SSH Key support in Bitwarden importer Add SSH Key support in Bitwarden Importer Mar 5, 2026
if (!publicKey.isEmpty() && !privateKey.isEmpty()) {
auto baseName = QString("id");

if (publicKey.startsWith("ssh-ed25519 ")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be enough to check the strings like this? And without the spaces.

if (publicKey.startsWith("ssh-ed25519") ...

if (publicKey.startsWith("ssh-rsa") || publicKey.startsWith("ssh-sha2") ...

if (publickey.startsWith("ecdsa-sha2") ...

if (publickey.startsWith("ssh-dss") ...

@droidmonkey droidmonkey added feature: SSH agent pr: new feature Pull request adds a new feature labels Mar 8, 2026
@droidmonkey droidmonkey added this to the v2.8.0 milestone Mar 8, 2026
@droidmonkey droidmonkey self-requested a review March 8, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: SSH agent pr: new feature Pull request adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants