summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-09-02 01:40:10 -0400
committerjoe <joe@jerkface.net>2016-09-02 01:40:10 -0400
commitbbd209a3b83b11d1c46b13bea35b534598827c12 (patch)
treea28a158cc54be800b8636957175d243d2c3d8ad3
parent9c5f1d6577e35d3d134a7ad32d4d4611f05342cd (diff)
Use randomized salt for default cipher.
-rw-r--r--lib/Kiki.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs
index 87b6ea5..45e67f8 100644
--- a/lib/Kiki.hs
+++ b/lib/Kiki.hs
@@ -195,8 +195,11 @@ importAndRefresh root cmn cipher = do
195 do rs <- writeKeyToFile (streaminfo { typ = PEMFile, access = Sec, spill = KF_Match "tor", fill = KF_All }) (FileDesc write_tor) tor_un 195 do rs <- writeKeyToFile (streaminfo { typ = PEMFile, access = Sec, spill = KF_Match "tor", fill = KF_All }) (FileDesc write_tor) tor_un
196 -- outputReport $ map (first show) rs 196 -- outputReport $ map (first show) rs
197 return () 197 return ()
198 let cipher's2k = (cipher {- AES128 -}, IteratedSaltedS2K SHA1 4073382889203176146 7864320) 198 cipher's2k <- do
199 ctx = InputFileContext secring pubring 199 IteratedSaltedS2K _ salt _ <- randomS2K SHA1
200 -- (cipher {- AES128 -}, IteratedSaltedS2K SHA1 4073382889203176146 7864320)
201 return $ (cipher {- AES128 -}, IteratedSaltedS2K SHA1 salt (15 * 2^19))
202 let ctx = InputFileContext secring pubring
200 main_passwds = withAgent $ do pfd <- maybeToList passfd 203 main_passwds = withAgent $ do pfd <- maybeToList passfd
201 return $ PassphraseSpec Nothing Nothing pfd 204 return $ PassphraseSpec Nothing Nothing pfd
202 passwordop = KeyRingOperation 205 passwordop = KeyRingOperation