Page MenuHomePhabricator

Create GPG wrapper library
Closed, ResolvedPublic

Description

From T12453:

create a standalone library (which can be reused by the extensions consuming the GPG keys) for one more level of wrapping, either around the PECL library or the command-line gpg tool directly. Unfortunately both of those require using a keyring. We probably don't want to leave around public keys (which might be secret) in /var/www/.gnupg/pubring.gpg of random machines; we also don't want to break other extensions using GPG by permanently changing the home directory. So we need to do something like: create temp dir -> set GNUPGHOME environment variable to temp dir -> run GPG commands -> reset GNUPGHOME and delete temp dir (use a scoped callback or something similar to make sure this happens). This kind of sucks but should be doable.

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: MediaWiki-Email.
Tgr subscribed.

We probably don't want to leave around public keys (which might be secret)

Public keys that might be secret??

The idea was (since then I dropped it) that if we keep the user's public key secret, it can serve as a proof that the email came from Wikimedia (since no one else knows the key). But it doesn't have any advantage over just having a Wikimedia secret key for signing.

Even so, I don't like the idea of using a permanent keyring file, to which keys are randomly added whenever we need to encrypt for another user. That sounds like debugging hell.

There is also a PEAR package called Crypt_GPG which could be an alternative to PECL.