aboutsummaryrefslogtreecommitdiff
path: root/Remote/Helper/Encryptable.hs
diff options
context:
space:
mode:
authorGravatar guilhem <guilhem@fripost.org>2013-03-29 17:06:02 +0100
committerGravatar Joey Hess <joey@kitenet.net>2013-03-29 18:04:52 -0400
commit71760a359f5515053085f242258dc615a1db1fd8 (patch)
tree0e49337fb773b721173aa25fc36635e05d8918f8 /Remote/Helper/Encryptable.hs
parentf3ee9b50b3a9caff7ec65ddaa9197f6daaf6f745 (diff)
Allow other MAC algorithms in the Remote Config.
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r--Remote/Helper/Encryptable.hs4
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