diff options
author | Joey Hess <joey@kitenet.net> | 2013-09-05 11:12:01 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-09-05 11:12:01 -0400 |
commit | c4990a41c430d541cefe27a53a39e7eb60e217a8 (patch) | |
tree | 21d81f15eb51cef5aa9a5047d0783e4ffbcb04e5 /Remote/Helper | |
parent | 217b0d3794ea466c64654b3bd91bbfb55cc40248 (diff) |
rename constructor for clariy
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/Encryptable.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs index 5c661eaa7..a6e79ddc4 100644 --- a/Remote/Helper/Encryptable.hs +++ b/Remote/Helper/Encryptable.hs @@ -36,9 +36,9 @@ encryptionSetup c = maybe genCipher updateCipher $ extractCipher c -- hybrid encryption is the default when a keyid is -- specified but no encryption _ | maybe (M.member "keyid" c) (== "hybrid") encryption -> - use "encryption setup" . genEncryptedCipher key HybridCipher + use "encryption setup" . genEncryptedCipher key Hybrid =<< highRandomQuality - Just "pubkey" -> use "encryption setup" . genEncryptedCipher key PubKeyCipher + Just "pubkey" -> use "encryption setup" . genEncryptedCipher key PubKey =<< highRandomQuality _ -> error $ "Specify " ++ intercalate " or " (map ("encryption=" ++) @@ -52,7 +52,7 @@ encryptionSetup c = maybe genCipher updateCipher $ extractCipher c updateCipher v = case v of SharedCipher _ | maybe True (== "shared") encryption -> return c' EncryptedCipher _ variant _ - | maybe True (== if variant == HybridCipher then "hybrid" else "pubkey") encryption -> + | maybe True (== if variant == Hybrid then "hybrid" else "pubkey") encryption -> use "encryption update" $ updateEncryptedCipher newkeys v _ -> cannotchange use m a = do @@ -154,9 +154,9 @@ extractCipher c = case (M.lookup "cipher" c, M.lookup "cipherkeys" c, M.lookup "encryption" c) of (Just t, Just ks, encryption) | maybe True (== "hybrid") encryption -> - Just $ EncryptedCipher (fromB64 t) HybridCipher (readkeys ks) + Just $ EncryptedCipher (fromB64 t) Hybrid (readkeys ks) (Just t, Just ks, Just "pubkey") -> - Just $ EncryptedCipher (fromB64 t) PubKeyCipher (readkeys ks) + Just $ EncryptedCipher (fromB64 t) PubKey (readkeys ks) (Just t, Nothing, encryption) | maybe True (== "shared") encryption -> Just $ SharedCipher (fromB64 t) _ -> Nothing |