summaryrefslogtreecommitdiff
path: root/Remote/Helper/Encryptable.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-26 12:06:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-26 14:42:32 -0400
commit4e48ea601400dac5f432b1eaa454acd219a029ad (patch)
tree30b3eb2964e2e3fce4781a50b0d6292fbfedfa28 /Remote/Helper/Encryptable.hs
parent70bb36cfc783a27345aa7eba2c9f89ecce748898 (diff)
store S3 creds in a 600 mode file inside the local git repo
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r--Remote/Helper/Encryptable.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs
index 880db5c6a..8ed2fed63 100644
--- a/Remote/Helper/Encryptable.hs
+++ b/Remote/Helper/Encryptable.hs
@@ -88,6 +88,11 @@ remoteCipher c = go $ extractCipher c
Annex.changeState (\s -> s { Annex.ciphers = M.insert encipher cipher cache })
return $ Just cipher
+{- Checks if there is a trusted (non-shared) cipher. -}
+isTrustedCipher :: RemoteConfig -> Bool
+isTrustedCipher c =
+ isJust (M.lookup "cipherkeys" c) && isJust (M.lookup "cipher" c)
+
{- Gets encryption Cipher, and encrypted version of Key. -}
cipherKey :: Maybe RemoteConfig -> Key -> Annex (Maybe (Cipher, Key))
cipherKey Nothing _ = return Nothing