From 63f03c53bcf64807fe26c28fec946502faa1651e Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 06:33:16 -0400 Subject: weaker than applicative --- lib/Kiki.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Kiki.hs b/lib/Kiki.hs index f82d08a..58dfa20 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -355,7 +355,7 @@ installIpsecPeerCertificate fw p@Peer{kd} = IpsecPeerConfig <$> flip (either warn') (pemFromPacket k :: Either String String) $ \pem -> do case sshs of (sshkey:_) -> do - theirHostname <- ResolvableHostname <$> sshKeyToHostname sshkey + let theirHostname = ResolvableHostname $ sshKeyToHostname sshkey write fw (peerCertPath p) pem return $ strongswanPeerConfiguration p theirHostname _ -> error "fuck." @@ -584,14 +584,14 @@ writePublicKeyFiles rt fw grip myId = do fileWriterCommit fw -sshKeyToHostname :: Applicative m => Packet -> m Char8.ByteString +sshKeyToHostname :: Packet -> Char8.ByteString sshKeyToHostname sshkey = do case rsaKeyFromPacket sshkey of Just (RSAKey (MPI n) (MPI e)) -> do let blob = SSH.sshrsa e n sha1 = C.hashlazy blob :: C.Digest C.SHA1 - pure $ Char8.fromStrict (convertToBase Base16 sha1) <> ".ssh.cryptonomic.net" - Nothing -> pure "" + Char8.fromStrict (convertToBase Base16 sha1) <> ".ssh.cryptonomic.net" + Nothing -> "" peerConnectionName :: Peer -> Char8.ByteString peerConnectionName = coerce . peerAddress @@ -660,7 +660,7 @@ show_sshfp keyspec wkgrip db = do let s = parseSpec wkgrip keyspec case selectPublicKey s db of Nothing -> hPutStrLn stderr $ keyspec ++ ": not found" - Just k -> Char8.putStrLn =<< sshKeyToHostname k + Just k -> Char8.putStrLn $ sshKeyToHostname k show_ssh :: String -> String -> KeyDB -> IO () show_ssh keyspec wkgrip db = either warn putStrLn $ show_ssh' keyspec wkgrip db -- cgit v1.2.3