summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--KeyRing.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/KeyRing.hs b/KeyRing.hs
index 58868b6..3897ef5 100644
--- a/KeyRing.hs
+++ b/KeyRing.hs
@@ -4,8 +4,6 @@
4{-# LANGUAGE OverloadedStrings #-} 4{-# LANGUAGE OverloadedStrings #-}
5{-# LANGUAGE DeriveFunctor #-} 5{-# LANGUAGE DeriveFunctor #-}
6{-# LANGUAGE DoAndIfThenElse #-} 6{-# LANGUAGE DoAndIfThenElse #-}
7{-# LANGUAGE RankNTypes #-}
8{-# LANGUAGE KindSignatures #-}
9module KeyRing 7module KeyRing
10 ( InputFile(..) 8 ( InputFile(..)
11 , backsig 9 , backsig
@@ -196,7 +194,7 @@ initializer (MutableRef x) = x
196initializer _ = Nothing 194initializer _ = Nothing
197 195
198getUsage :: 196getUsage ::
199 forall (m :: * -> *). MonadPlus m => FileType -> m UsageTag 197 MonadPlus m => FileType -> m UsageTag
200getUsage (PEMFile usage) = return usage 198getUsage (PEMFile usage) = return usage
201getUsage _ = mzero 199getUsage _ = mzero
202 200
@@ -1653,7 +1651,7 @@ runKeyRing operation = do
1653 1651
1654 return ret 1652 return ret
1655 1653
1656 1654parseOptionFile :: FilePath -> IO [String]
1657parseOptionFile fname = do 1655parseOptionFile fname = do
1658 xs <- fmap lines (readFile fname) 1656 xs <- fmap lines (readFile fname)
1659 let ys = filter notComment xs 1657 let ys = filter notComment xs
@@ -1705,20 +1703,27 @@ getHomeDir protohome = do
1705 1703
1706#if MIN_VERSION_base(4,6,0) 1704#if MIN_VERSION_base(4,6,0)
1707#else 1705#else
1706lookupEnv :: String -> IO (Maybe String)
1708lookupEnv var = 1707lookupEnv var =
1709 handleIO_ (return Nothing) $ fmap Just (getEnv var) 1708 handleIO_ (return Nothing) $ fmap Just (getEnv var)
1710#endif 1709#endif
1711 1710
1711isKey :: Packet -> Bool
1712isKey (PublicKeyPacket {}) = True 1712isKey (PublicKeyPacket {}) = True
1713isKey (SecretKeyPacket {}) = True 1713isKey (SecretKeyPacket {}) = True
1714isKey _ = False 1714isKey _ = False
1715 1715
1716isUserID :: Packet -> Bool
1716isUserID (UserIDPacket {}) = True 1717isUserID (UserIDPacket {}) = True
1717isUserID _ = False 1718isUserID _ = False
1718 1719
1720isTrust :: Packet -> Bool
1719isTrust (TrustPacket {}) = True 1721isTrust (TrustPacket {}) = True
1720isTrust _ = False 1722isTrust _ = False
1721 1723
1724sigpackets ::
1725 Monad m =>
1726 Word8 -> [SignatureSubpacket] -> [SignatureSubpacket] -> m Packet
1722sigpackets typ hashed unhashed = return $ 1727sigpackets typ hashed unhashed = return $
1723 signaturePacket 1728 signaturePacket
1724 4 -- version 1729 4 -- version