convert StorableCipher to ByteString
This allows getting rid of the ugly and error prone handling of
"bag of bytes" String in Remote.Helper.Encryptable.
Avoiding breakage like that dealt with by commit
9862d64bf9
And allows converting Utility.Gpg to use ByteString for IO, which is
a welcome change.
Tested the new git-annex interoperability with old, using all 3
encryption= types.
Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
be6b56df4c
commit
c41ca6c832
5 changed files with 45 additions and 68 deletions
|
@ -25,6 +25,7 @@ import Utility.Gpg (KeyIds(..))
|
|||
|
||||
import Data.Typeable
|
||||
import qualified Data.Map as M
|
||||
import Data.ByteString (ByteString)
|
||||
|
||||
data EncryptionMethod
|
||||
= NoneEncryption
|
||||
|
@ -35,12 +36,12 @@ data EncryptionMethod
|
|||
deriving (Typeable, Eq)
|
||||
|
||||
-- XXX ideally, this would be a locked memory region
|
||||
data Cipher = Cipher String | MacOnlyCipher String
|
||||
data Cipher = Cipher ByteString | MacOnlyCipher ByteString
|
||||
|
||||
data StorableCipher
|
||||
= EncryptedCipher String EncryptedCipherVariant KeyIds
|
||||
| SharedCipher String
|
||||
| SharedPubKeyCipher String KeyIds
|
||||
= EncryptedCipher ByteString EncryptedCipherVariant KeyIds
|
||||
| SharedCipher ByteString
|
||||
| SharedPubKeyCipher ByteString KeyIds
|
||||
deriving (Ord, Eq)
|
||||
data EncryptedCipherVariant = Hybrid | PubKey
|
||||
deriving (Ord, Eq)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue