support annex.shared-sop-command for encryption=shared
authorJoey Hess <joeyh@joeyh.name>
Fri, 12 Jan 2024 17:29:34 +0000 (13:29 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 12 Jan 2024 17:31:18 +0000 (13:31 -0400)
commit7e69063a2932ad2efce5c84d6506688a0dbe08ba
treed9d211db7dfa7b454fe02483230ac5f8005f6b81
parentdd3e7790209a935c5712cd7c85017d931c490b4a
support annex.shared-sop-command for encryption=shared

This works well, and it interoperates with gpg in my testing (although some
SOP commands might choose to use a profile that does not so caveat emptor).

Note that for creating the Cipher, gpg --gen-random is still used. SOP
does not have an eqivilant, and as long as the user has gpg around,
which seems likely, it doesn't matter that it uses gpg here, it's not being
used for encryption. That seemed better than implementing a second way
to get high quality entropy, at least for now.

The need for the sop command to run in an empty directory has each call
to encrypt and decrypt creating a new temporary directory. That is some
unncessary overhead, though probably swamped by the overhead of running
the sop command. This could be improved in the future by passing an
already empty directory to them, or a sufficiently empty directory
(.git/annex/tmp would probably suffice).

Sponsored-by: Brett Eisenberg on Patreon
CHANGELOG
Crypto.hs
Remote/Helper/Chunked.hs
Types/Crypto.hs
Types/GitConfig.hs
Utility/StatelessOpenPGP.hs
doc/todo/support_using_Stateless_OpenPGP_instead_of_gpg.mdwn