From 90c2ea4ba234d7d049d72c2078044bc2a24e3977 Mon Sep 17 00:00:00 2001 From: joe Date: Tue, 29 Apr 2014 19:55:56 -0400 Subject: readKeyFromFile now accepts InputFile instead of FilePath --- KeyRing.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'KeyRing.hs') diff --git a/KeyRing.hs b/KeyRing.hs index f9720fa..8d527e6 100644 --- a/KeyRing.hs +++ b/KeyRing.hs @@ -1103,14 +1103,14 @@ try x body = Left e -> return e Right x -> body x -readKeyFromFile :: Bool -> String -> FilePath -> IO Message +readKeyFromFile :: Bool -> String -> InputFile -> IO Message readKeyFromFile False "PEM" fname = do -- warn $ fname ++ ": reading ..." + let ctx = InputFileContext "" "" -- Note: The key's timestamp is included in it's fingerprint. -- Therefore, we should attempt to preserve it. - timestamp <- handleIO_ (error $ fname++": modificaiton time?") $ - modificationTime <$> getFileStatus fname - input <- L.readFile fname + timestamp <- getInputFileTime ctx fname + input <- readInputFileL ctx fname let dta = extractPEM "RSA PRIVATE KEY" input -- Char8.putStrLn $ "dta = " <> dta let rsa = do @@ -1161,7 +1161,7 @@ doImport -> ([Char], Maybe [Char], [k], t) -> IO (KikiCondition (Map.Map k KeyData, [(FilePath,KikiReportAction)])) doImport doDecrypt db (fname,subspec,ms,_) = do - let fetchkey = readKeyFromFile False "PEM" fname + let fetchkey = readKeyFromFile False "PEM" (ArgFile fname) flip (maybe $ return CannotImportMasterKey) subspec $ \tag -> do Message parsedkey <- fetchkey -- cgit v1.2.3