From 29a3e765236340f5c19c92de7913d3a1997fcd5b Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 15:00:46 -0400 Subject: aging ifdefs moved to nursing home --- lib/Kiki.hs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'lib') diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 5481241..7cb373c 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -37,12 +37,8 @@ import System.Posix.Files import System.Posix.Types (FileMode) import System.Posix.IO as Posix (createPipe) import System.Posix.User -#if defined(VERSION_memory) import Data.ByteArray.Encoding import qualified Data.ByteString.Char8 as S8 -#elif defined(VERSION_dataenc) -import qualified Codec.Binary.Base64 as Base64 -#endif import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as Char8 import qualified Data.Map.Strict as Map @@ -74,18 +70,12 @@ cipherFromString s = _ -> error $ "known ciphers: "++unwords (map ciphername ciphers) {- where -#if defined(VERSION_memory) unhex hx = case convertFromBase Base16 (S8.pack hx) of Left e -> do -- Useful for debugging but insecure generally ;) -- putStrLn $ "convertFromBase error for input "++show hx++": "++show e return Nothing Right bs -> return $ Just $ S8.unpack bs -#elif defined(VERSION_dataenc) - unhex hx = maybe (return () {- putStrLn $ "dataenc error for input "++show hx -}) - return - $ fmap (map $ chr . fromIntegral) $ Base16.decode hx -#endif -} @@ -619,21 +609,11 @@ showA addr = if null bracket then pre else drop 1 pre where (pre,bracket) = break (==']') (show addr) -#if !MIN_VERSION_base(4,8,0) -sortOn :: Ord b => (a -> b) -> [a] -> [a] -sortOn f = - map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x)) -#endif - pemFromPacket :: Monad m => Packet -> m String pemFromPacket k = do let rsa = pkcs8 . fromJust $ rsaKeyFromPacket k der = encodeASN1 DER (toASN1 rsa []) -#if defined(VERSION_memory) qq = S8.unpack $ convertToBase Base64 (L.toStrict der) -#elif defined(VERSION_dataenc) - qq = Base64.encode (L.unpack der) -#endif return $ writePEM PemPublicKey qq -- ("TODO "++show keyspec) -- cgit v1.2.3