freedomofpress/securedrop — pull request #177 by garrettr (2013-12-01 18:06:41+00:00)
Title: Feature/142/journalist pubkey

Closes #142.

Note that we do actually end up re-encrypting the encrypted submission, per the [comment](https://github.com/freedomofpress/securedrop/issues/142#issuecomment-28164928) from @runasand on the original issue. This is a slight waste of performance resources, but I think it's ok for the following reasons:

1. We are still using the "all submissions are wrapped in a zip file" trick, which both reduces the size of the encrypted submissions and also lets us easily preserve the original filenames. Continuing this with file uploads that may also be encrypted avoids a special case and lets us easily maintain the names of the encrypted submission files. It also means I don't have to write another test for this case, since it is no different from every other file upload :grins:
2. In case a user *accidentally* uploaded an unencrypted file with a `.gpg` extension (or that could somehow trick `file` into think it was "GPG encrypted data" when it wasn't, which is pretty unlikely), it will get encrypted anyway.