Skip to content

fix(pgp): hide bcc key ids, match signer to from, ask on unchecked keys - #595

Closed
hanthor wants to merge 2 commits into
hyprlab:mainfrom
tuna-os:fix/pgp-hardening
Closed

hanthor wants to merge 2 commits into
hyprlab:mainfrom
tuna-os:fix/pgp-hardening

Conversation

@hanthor

@hanthor hanthor commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Three OpenPGP fixes:

  • Bcc key ids. Bcc recipients were passed to gpg as ordinary recipients, so every copy of an encrypted message named their key ids. They now go as --hidden-recipient, each resolved to the fingerprint of the checked key so gpg uses that key and not the first match for the address.
  • Signer vs From. A good signature from a key whose user ids don't include the From address used to show green. It now shows amber as "Signed by another address", with a note naming the From address. PgpSignature::Good gains from_mismatch, serde-defaulted and skipped when false, so cache goldens don't change.
  • Unchecked keys. Encryption still uses --trust-model always, but the composer now asks before sending to a recipient whose key nothing vouches for (Send Anyway keeps it possible), and public_key_for prefers a vouched key when an address has several.

Tests run against real throwaway gpg keyrings: the Bcc key id is zeroed in the packet and still decrypts, the From mismatch (case-insensitive), vouched-key choice per user id.

Bcc recipients go to gpg as hidden recipients, so To and Cc cannot see whose keys were Bcc'd. A good signature from a key without the From address shows amber, not green. Encrypting to a key the keyring does not vouch for asks first in the composer, and each address is encrypted to the checked key by fingerprint, preferring a vouched one.
hyprlab added a commit that referenced this pull request Nov 6, 2026
Bcc recipients go to gpg as hidden recipients, so To and Cc cannot see whose keys were Bcc'd. A good signature from a key without the From address shows amber, not green. Encrypting to a key the keyring does not vouch for asks first in the composer, and each address is encrypted to the checked key by fingerprint, preferring a vouched one.

Co-Authored-By: James Reilly <5840441+hanthor@users.noreply.github.com>
hyprlab added a commit that referenced this pull request Nov 6, 2026
gpg's trust line is the key's best validity, so an address added after a key was trusted passed as checked. Green now needs that address vouched for, and Trust covers it. The unchecked-key prompt came at every send and could not always be cleared: Send Anyway is remembered per address and fingerprint, Settings offers Trust for an added address, and trusting with an imported key of one's own now counts.
hyprlab added a commit that referenced this pull request Nov 6, 2026
Send Anyway was remembered with no way back short of editing a file. Settings → OpenPGP lists those keys while the answer still matters, and Ask Again takes it back. Removing a key forgets it too. The page reads again on each visit, since the composer changes the list while Settings sits hidden.
hyprlab added a commit that referenced this pull request Nov 8, 2026
Cache encryption (#601), the security batch (#595 to #600), Esc in Undo Send (#607), Focus Mode's own page, the palettes removed, flowed plain text (#606), the remote cache folder (#614), the calendar crash and Russian (#611), Aster Mail drafts (#604) and theme colors (#593).
@hyprlab

hyprlab commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Agentic reply:

Your Bcc, signer and unchecked-key changes are in the 1.48.0-beta.3 release, landed by hand and credited to you. At landing, Send Anyway is remembered per address and key, and Settings → OpenPGP lists those keys with Ask Again. The From address is checked against each of the key's addresses, an address added to a trusted key stays amber until the key is trusted again, and trusting an imported key of your own now works. Please test it there and report anything that doesn't look right. It reaches the stable channel with the next stable release.

#602 and #603 are built on this branch, so they need rebasing onto main.

The beta build is in the repo now. If you already have the beta installed, flatpak update picks it up. If not, download and install it first:

flatpak install --user --from https://hylki.hyprlab.co/flatpak/co.hyprlab.Hylki.Beta.flatpakref

RPM, Debian and AppImage betas: Beta channel.

@hyprlab hyprlab closed this Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants