diff options
-rw-r--r-- | KeyRing.hs | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 #-} | ||
9 | module KeyRing | 7 | module KeyRing |
10 | ( InputFile(..) | 8 | ( InputFile(..) |
11 | , backsig | 9 | , backsig |
@@ -196,7 +194,7 @@ initializer (MutableRef x) = x | |||
196 | initializer _ = Nothing | 194 | initializer _ = Nothing |
197 | 195 | ||
198 | getUsage :: | 196 | getUsage :: |
199 | forall (m :: * -> *). MonadPlus m => FileType -> m UsageTag | 197 | MonadPlus m => FileType -> m UsageTag |
200 | getUsage (PEMFile usage) = return usage | 198 | getUsage (PEMFile usage) = return usage |
201 | getUsage _ = mzero | 199 | getUsage _ = mzero |
202 | 200 | ||
@@ -1653,7 +1651,7 @@ runKeyRing operation = do | |||
1653 | 1651 | ||
1654 | return ret | 1652 | return ret |
1655 | 1653 | ||
1656 | 1654 | parseOptionFile :: FilePath -> IO [String] | |
1657 | parseOptionFile fname = do | 1655 | parseOptionFile 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 |
1706 | lookupEnv :: String -> IO (Maybe String) | ||
1708 | lookupEnv var = | 1707 | lookupEnv var = |
1709 | handleIO_ (return Nothing) $ fmap Just (getEnv var) | 1708 | handleIO_ (return Nothing) $ fmap Just (getEnv var) |
1710 | #endif | 1709 | #endif |
1711 | 1710 | ||
1711 | isKey :: Packet -> Bool | ||
1712 | isKey (PublicKeyPacket {}) = True | 1712 | isKey (PublicKeyPacket {}) = True |
1713 | isKey (SecretKeyPacket {}) = True | 1713 | isKey (SecretKeyPacket {}) = True |
1714 | isKey _ = False | 1714 | isKey _ = False |
1715 | 1715 | ||
1716 | isUserID :: Packet -> Bool | ||
1716 | isUserID (UserIDPacket {}) = True | 1717 | isUserID (UserIDPacket {}) = True |
1717 | isUserID _ = False | 1718 | isUserID _ = False |
1718 | 1719 | ||
1720 | isTrust :: Packet -> Bool | ||
1719 | isTrust (TrustPacket {}) = True | 1721 | isTrust (TrustPacket {}) = True |
1720 | isTrust _ = False | 1722 | isTrust _ = False |
1721 | 1723 | ||
1724 | sigpackets :: | ||
1725 | Monad m => | ||
1726 | Word8 -> [SignatureSubpacket] -> [SignatureSubpacket] -> m Packet | ||
1722 | sigpackets typ hashed unhashed = return $ | 1727 | sigpackets typ hashed unhashed = return $ |
1723 | signaturePacket | 1728 | signaturePacket |
1724 | 4 -- version | 1729 | 4 -- version |