8000 fix(pgp): hide bcc key ids, match signer to from, ask on unchecked keys by hanthor · Pull Request #595 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

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

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

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.
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.

1 participant

C4F
0