From 006d1f0b7f36c25a91006fce24cbe76416fcee86 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 15:22:45 -0400 Subject: no cpp needed, since my love is unconditional --- lib/SSHKey.hs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'lib/SSHKey.hs') diff --git a/lib/SSHKey.hs b/lib/SSHKey.hs index 0ded986..81df18c 100644 --- a/lib/SSHKey.hs +++ b/lib/SSHKey.hs @@ -1,16 +1,11 @@ {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE CPP #-} module SSHKey where import qualified Data.ByteString.Lazy.Char8 as L8 import qualified Data.ByteString.Lazy as L -#if defined(VERSION_memory) import qualified Data.ByteString.Char8 as S8 import Data.ByteArray.Encoding import FunctorToMaybe -#elif defined(VERSION_dataenc) -import qualified Codec.Binary.Base64 as Base64 -#endif import Data.Binary.Get ( runGet ) import Data.Binary.Put ( putWord32be, runPut, putByteString ) import Data.Binary ( get, put ) @@ -34,11 +29,7 @@ keyblob :: Key -> L.ByteString keyblob (n,e) = "ssh-rsa " <> blob where bs = sshrsa e n -#if defined(VERSION_memory) blob = L.fromStrict $ convertToBase Base64 (L.toStrict bs) -#elif defined(VERSION_dataenc) - blob = L8.pack $ Base64.encode (L.unpack bs) -#endif blobkey :: L8.ByteString -> Maybe Key blobkey bs = do @@ -47,11 +38,7 @@ blobkey bs = do let (sp,bs2) = L8.span isSpace bs1 guard $ not (L8.null sp) bs3 <- listToMaybe $ L8.words bs2 -#if defined(VERSION_memory) qq <- fmap L.fromStrict $ functorToMaybe $ convertFromBase Base64 $ L.toStrict bs3 -#elif defined(VERSION_dataenc) - qq <- L.pack `fmap` Base64.decode (L8.unpack bs3) -#endif decode_sshrsa qq where decode_sshrsa :: L8.ByteString -> Maybe Key -- cgit v1.2.3