Skip to content

fix(ox): filter keys listed by /ox keys to those matching xmpp prefix#2178

Merged
jubalh merged 1 commit into
masterfrom
fix/2177
Jun 16, 2026
Merged

fix(ox): filter keys listed by /ox keys to those matching xmpp prefix#2178
jubalh merged 1 commit into
masterfrom
fix/2177

Conversation

@jubalh

@jubalh jubalh commented Jun 15, 2026

Copy link
Copy Markdown
Member

The /ox keys command previously listed all PGP keys known to the system, displaying a massive number of keys of which the vast majority cannot be used for OX.

According to XEP-0373: OpenPGP for XMPP, the User ID of the key must correspond to the JID of the user as an 'xmpp' URI ("xmpp:juliet@example.org"). General PGP keys in the user's keyring that lack this prefix are invalid for OX.

  • Introduce internal helper _ox_gpg_get_keys() to retrieve keys containing an 'xmpp:' UID prefix.
  • Create new ox_gpg_list_keys() that runs a second-pass query specifically looking for corresponding private keys in the secret keyring.
  • Update /ox keys to call ox_gpg_list_keys() instead of the generic p_gpg_list_keys().

Fixes: #2177

prefix

The `/ox keys` command previously listed all PGP keys known to the system,
displaying a massive number of keys of which the vast majority cannot be
used for OX.

According to XEP-0373: OpenPGP for XMPP, the User ID of the key must correspond
to the JID of the user as an 'xmpp' URI ("xmpp:juliet@example.org").
General PGP keys in the user's keyring that lack this prefix are invalid for OX.

* Introduce internal helper `_ox_gpg_get_keys()` to retrieve keys
  containing an 'xmpp:' UID prefix.
* Create new `ox_gpg_list_keys()` that runs a second-pass query
  specifically looking for corresponding private keys in the secret
  keyring.
* Update `/ox keys` to call `ox_gpg_list_keys()` instead of the generic
  `p_gpg_list_keys()`.

Fixes: #2177
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Jun 15, 2026
@jubalh jubalh self-assigned this Jun 15, 2026
@jubalh

jubalh commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@mdosch please test :)

@jubalh jubalh changed the title fix(ox): filter keys listed by /ox keys to those matching xmpp: fix(ox): filter keys listed by /ox keys to those matching xmpp prefix Jun 15, 2026
@mdosch

mdosch commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Works well, thanks!

@jubalh jubalh merged commit f751125 into master Jun 16, 2026
12 checks passed
@jubalh jubalh deleted the fix/2177 branch June 16, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ox: Listing keys lists all PGP keys in the system

2 participants