From ae8792ee7c51da15e52f30475c17ce589f940509 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 1 Jul 2019 14:26:58 -0400 Subject: add type signatures --- lib/GnuPGAgent.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/GnuPGAgent.hs b/lib/GnuPGAgent.hs index 18f1c25..2a68b4e 100644 --- a/lib/GnuPGAgent.hs +++ b/lib/GnuPGAgent.hs @@ -119,6 +119,7 @@ percentPlusEscape s = do _ | c < ' ' -> printf "%%%02X" (ord c) _ -> return c +clearPassphrase :: GnuPGAgent -> Packet -> IO () clearPassphrase agent key = do let cmd = "clear_passphrase --mode=normal "++fingerprint key hPutStrLn (agentHandle agent) cmd @@ -164,6 +165,7 @@ getPassphrase agent ask (Query key uid masterkey) = do #endif "ERR" -> return Nothing +quit :: GnuPGAgent -> IO () quit (GnuPGAgent h) = hClose h prompts :: Packet -> String -> Maybe Packet -> (String,String,String) @@ -203,6 +205,7 @@ gpgHomeSpec = HomeDir , appdir = ".gnupg" } +envhomedir :: Maybe [Char] -> HomeDir -> IO (Maybe [Char]) envhomedir opt home = do gnupghome <- fmap (mfilter (/="")) $ lookupEnv (homevar home) homed <- fmap (mfilter (/="") . Just) getHomeDirectory @@ -242,6 +245,7 @@ curve_oid_nbits (MPI 0x2b8104000a ) = 256 -- SEC p256k1 ( bitcoin curve ) curve_oid_nbits n = trace ("Unknown curve: "++ show n) 0 +mpi_nbits :: Num a => MPI -> a mpi_nbits (MPI n) = 8 * fromIntegral len where len = case encode_bigendian n of -- cgit v1.2.3