Skip to content

Client-added keys not persisted past Service Worker restart #25

@ralimi

Description

@ralimi

Chrome is requiring all extensions to move to Manifest V3 in Chrome, which means using Service Workers instead of a persistent background page.
Service Workers have the Chrome will forcibly suspend them after some time (see https://bugs.chromium.org/p/chromium/issues/detail?id=1152255). This means the instance of the Agent is destroyed, losing all of its loaded keys.

We can list the loaded keys, but we only get back Key instances which (understandably) do not contain the private key material. This makes it impossible for us to save them to be added back when the Service Worker restarts.

For keys loaded via the extension's UI, this is fine since our code loads them to the agent. We store the private key unencrypted in memory in chrome.storage.session (which is fine since the private key was in the Agent anyways), which allows us to add it back when the Service Worker restarts.

However, then a connected ssh client adds a key to the agent, we don't see the private key, and hence have no way to restore it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions