Generate ciphers with a better entropy.

Unless highRandomQuality=false (or --fast) is set, use Libgcypt's
'GCRY_VERY_STRONG_RANDOM' level by default for cipher generation, like
it's done for OpenPGP key generation.

On the assistant side, the random quality is left to the old (lower)
level, in order not to scare the user with an enless page load due to
the blocking PRNG waiting for IO actions.
This commit is contained in:
guilhem 2013-04-05 21:06:16 +02:00 committed by Joey Hess
parent 602baae12e
commit 00fc21bfec
6 changed files with 41 additions and 19 deletions

View file

@ -69,11 +69,15 @@ makeRsyncRemote name location = makeRemote name location $
, ("type", "rsync")
]
{- Inits a special remote. -}
{- Inits a special remote. Currently, only 'weak' ciphers can be
- generated from the assistant, because otherwise GnuPG may block once
- the entropy pool is drained, and as of now there's no way to tell the
- user to perform IO actions to refill the pool. -}
makeSpecialRemote :: String -> RemoteType -> R.RemoteConfig -> Annex ()
makeSpecialRemote name remotetype config = do
(u, c) <- Command.InitRemote.findByName name
c' <- R.setup remotetype u $ M.union config c
c' <- R.setup remotetype u $
M.insert "highRandomQuality" "false" $ M.union config c
describeUUID u name
configSet u c'