diff options
author | guilhem <guilhem@fripost.org> | 2013-03-29 17:06:02 +0100 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-29 18:04:52 -0400 |
commit | 71760a359f5515053085f242258dc615a1db1fd8 (patch) | |
tree | 0e49337fb773b721173aa25fc36635e05d8918f8 /Remote/Helper | |
parent | f3ee9b50b3a9caff7ec65ddaa9197f6daaf6f745 (diff) |
Allow other MAC algorithms in the Remote Config.
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/Encryptable.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs index 4f0404f2a..f3b6bb787 100644 --- a/Remote/Helper/Encryptable.hs +++ b/Remote/Helper/Encryptable.hs @@ -12,6 +12,7 @@ import qualified Data.Map as M import Common.Annex import Types.Remote import Crypto +import Types.Crypto import qualified Annex import Config.Cost import Utility.Base64 @@ -107,7 +108,8 @@ embedCreds c cipherKey :: RemoteConfig -> Key -> Annex (Maybe (Cipher, Key)) cipherKey c k = maybe Nothing make <$> remoteCipher c where - make ciphertext = Just (ciphertext, encryptKey ciphertext k) + make ciphertext = Just (ciphertext, encryptKey mac ciphertext k) + mac = fromMaybe defaultMac $ M.lookup "mac" c >>= readMac {- Stores an StorableCipher in a remote's configuration. -} storeCipher :: RemoteConfig -> StorableCipher -> RemoteConfig |