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

OpenPGP Keys lost on fresh session #973

Closed
TheCuteFoxxy opened this issue Feb 16, 2023 · 5 comments
Closed

OpenPGP Keys lost on fresh session #973

TheCuteFoxxy opened this issue Feb 16, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@TheCuteFoxxy
Copy link

Describe the bug
Encryption keys are cleared when the browser cache is cleared or when used in an incognito tab regardless of store and backup settings.

To Reproduce
Steps to reproduce the behavior:

  1. Login to Snappymail via regular browsing window (not private)
  2. Select Generate a key pair with OpenPGP.js
  3. Select all backup and store options during the generation
  4. Generate key pair
  5. Confirm key generation for both public and private keys
  6. Open an incognito/private window
  7. Login to Snappymail
  8. Check public/private key list for OpenPGP.js
  9. Observe missing keys

Expected behavior
Keys persist in Snappymail regardless of cache when store and backup options are selected

Screenshots
Generate Key Pair completed form
https://cdn.thecutefoxxy.com/AZoMzF.png

Resulting Key Pair
https://cdn.thecutefoxxy.com/9XXUmP.png

Missing Keys
https://cdn.thecutefoxxy.com/1GwBFY.png

Please complete the following information:

  • Browser: Firefox 109.0
  • IMAP daemon: Unknown
  • PHP version: 7.4.33
  • SnappyMail Version: 2.25.4

Debug/logging information
Not sure which logs are needed, if any, let me know and I will attach.

Additional context
Add any other context about the problem here.

@the-djmaze
Copy link
Owner

Correct. Keys stored on server are not loaded in OpenPGP.js
The problem is that private keys on server are passphrase protected and can't be loaded automatically.
It is also not mentioned in #89

The settings page could have enhancements in the OpenPGP.js section

  1. "Import public keys from GnuPG" checkbox
  2. "Import private keys from GnuPG" checkbox (asks password for each)
  3. "Import public keys from backup" checkbox
  4. "Import private keys from backup" checkbox

The settings page could also have a new section named "Backup"

@TheCuteFoxxy
Copy link
Author

Private keys I can understand due to the additional authentication step, this issue affects all keys including the public. Is there a way to prevent average users from accidentally clearing their keys? (Meaning users who wouldn't have a regular reason to start fresh sessions).

Is there an expiration time that can be modified to prevent a natural decay of the keys or would this only occur when a fresh session is forced for the browser?

@the-djmaze
Copy link
Owner

Is there a way to prevent average users from accidentally clearing their keys?

No, users should always manage that themselves.
How else could they use the keys in other applications?
Same rules apply as for your other password, pin, totp, etc. management.

the-djmaze pushed a commit that referenced this issue Feb 17, 2023
@the-djmaze
Copy link
Owner

OpenPGP.js doesn't require keys when GnuPG works and has keys.
SnappyMail then just sign, verify, encrypt and decrypt on the server (easy when using multiple browsers and as benefit the attachments are encrypted).

If you don't trust the server, then the only problem is sign and decrypt because they use private keys.
So i will improve the generate key dialog that it will provide the private key as download.

@the-djmaze the-djmaze added the enhancement New feature or request label Feb 12, 2024
@the-djmaze
Copy link
Owner

Next release will have many improvements regarding key handling.
It also has an "import from server" button to load the keys in OpenPGP.

afbeelding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants