From 78b3465431395222ddbea89691cfada20fb65af0 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 06:27:03 -0400 Subject: remove redundant field --- lib/Kiki.hs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/Kiki.hs') diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 292197a..f82d08a 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -378,10 +378,10 @@ ipsecPath :: String -> Char8.ByteString -> String ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName ipsecKeyPath :: MyIdentity -> FilePath -ipsecKeyPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "private" (addr <> ".pem") +ipsecKeyPath (MyIdentity (Char8.pack . showA -> addr)) = ipsecPath "private" (addr <> ".pem") ipsecCertPath :: MyIdentity -> FilePath -ipsecCertPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "certs" (addr <> ".pem") +ipsecCertPath (MyIdentity (Char8.pack . showA -> addr)) = ipsecPath "certs" (addr <> ".pem") peerCertPath :: Peer -> FilePath peerCertPath = ipsecPath "certs" . coerce . peerCertificateName @@ -475,12 +475,11 @@ getSshKnownHosts peer@Peer{kd} = Char8.unlines taggedblobs map ((coerce n <> " ") <>) blobs data MyIdentity = MyIdentity { - myGpgAddress :: SockAddr, - myCertificateBasename :: Char8.ByteString + myGpgAddress :: SockAddr } installIpsecConf :: FileWriter -> MyIdentity -> [Peer] -> IO () -installIpsecConf fw (MyIdentity wkaddr certBasename) cs = do +installIpsecConf fw (MyIdentity wkaddr) cs = do snippets <- mapM (coerce . installIpsecPeerCertificate fw) cs writeL fw "ipsec.conf" . Char8.unlines $ [ "conn %default" @@ -495,7 +494,7 @@ installIpsecConf fw (MyIdentity wkaddr certBasename) cs = do , " leftsubnet=" <> Char8.pack (showA wkaddr) <> "/128" , " leftauth=pubkey" , " leftid=" <> Char8.pack (showA wkaddr) - , " leftsigkey=" <> certBasename + , " leftsigkey=" <> Char8.pack (showA wkaddr) <> ".pem" , " leftikeport=4500" , " rightikeport=4500" , " right=%any" @@ -522,7 +521,7 @@ refreshCache rt rootdir = do flip (maybe $ warn "missing working key?") (rtWorkingKey rt) $ \wk -> do let grip = fingerprint wk - myId = MyIdentity wkaddr oname + myId = MyIdentity wkaddr exportOp = passphrases <> pemSecrets <> minimalOp False (CommonArgsParsed (Just $ takeDirectory $ rtPubring rt) -- cgit v1.2.3