From 88f69b2f64ca5af925bd2bcfa25c0a054e09f63c Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sat, 6 Jul 2019 15:23:56 -0400 Subject: Untested robustness fixes. --- lib/Kiki.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Kiki.hs') diff --git a/lib/Kiki.hs b/lib/Kiki.hs index eabd8ed..ca6e80f 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -262,11 +262,7 @@ importAndRefresh root cmn cipher = do HomeSec $ encode $ Message [packet master_un] putStrLn "Wrote master key" - -- FIXME: Why are we re-generating the tor key here? Does this - -- code get triggered when the user cancels the agent prompt? - -- If so, he's likely canceling encryption, not the .onion name - -- he was already shown. - return (Generate 0 (GenRSA $ 1024 `div` 8 ), []) + return (FileDesc read_tor, []) -- If the public ring does not exist, then creating an empty file is -- sufficient to satisfy 'runKeyRing'. However, as we've already generated @@ -311,7 +307,11 @@ importAndRefresh root cmn cipher = do } nop = KeyRingOperation - { opFiles = Map.empty + { opFiles = Map.fromList -- It's too late for a true no-op, + -- so we'll sync the keyrings at least. + [ ( HomeSec, buildStreamInfo KF_All KeyRingFile ) + , ( HomePub, (buildStreamInfo KF_All KeyRingFile) { access = Pub } ) + ] , opPassphrases = withAgent $ do pfd <- maybeToList passfd return $ PassphraseSpec Nothing Nothing pfd , opHome=homespec, opTransforms = [] -- cgit v1.2.3