diff options
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r-- | Remote/Helper/Encryptable.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs index f3b6bb787..ff7d4990b 100644 --- a/Remote/Helper/Encryptable.hs +++ b/Remote/Helper/Encryptable.hs @@ -31,15 +31,20 @@ encryptionSetup c = case (M.lookup "encryption" c, extractCipher c) of (Just "none", Just _) -> cannotchange (Just "shared", Just (EncryptedCipher _ _)) -> cannotchange (Just _, Just (SharedCipher _)) -> cannotchange - (Just "shared", Nothing) -> use "encryption setup" $ genSharedCipher - (Just keyid, Nothing) -> use "encryption setup" $ genEncryptedCipher keyid + (Just "shared", Nothing) -> use "encryption setup" . genSharedCipher + =<< highRandomQuality + (Just keyid, Nothing) -> use "encryption setup" . genEncryptedCipher keyid + =<< highRandomQuality (Just keyid, Just v) -> use "encryption updated" $ updateEncryptedCipher keyid v where cannotchange = error "Cannot change encryption type of existing remote." use m a = do cipher <- liftIO a showNote $ m ++ " " ++ describeCipher cipher - return $ M.delete "encryption" $ storeCipher c cipher + return $ M.delete "encryption" $ M.delete "highRandomQuality" $ + storeCipher c cipher + highRandomQuality = (&&) (maybe True (/="false") (M.lookup "highRandomQuality" c)) + <$> fmap not (Annex.getState Annex.fast) {- Modifies a Remote to support encryption. - |