From e9b27cd124d23a6e0d9e3b383827820d4ceafbeb Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 01:23:06 -0400 Subject: use gpg address instead of .onion name in strongswan config --- lib/Kiki.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Kiki.hs b/lib/Kiki.hs index de1219a..80f79b3 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -373,16 +373,16 @@ installIpsecPeerCertificate fw p@Peer{kd} = IpsecPeerConfig <$> $ getSubkeys CrossSigned their_master (keySubKeys kd) "ssh-server" ipsecPath :: String -> Char8.ByteString -> String -ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName ++ ".pem" +ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName ipsecKeyPath :: MyIdentity -> FilePath -ipsecKeyPath (MyIdentity _ theBaseName) = ipsecPath "private" theBaseName +ipsecKeyPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "private" (addr <> ".pem") ipsecCertPath :: MyIdentity -> FilePath -ipsecCertPath (MyIdentity _ theBaseName) = ipsecPath "certs" theBaseName +ipsecCertPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "certs" (addr <> ".pem") peerCertPath :: Peer -> FilePath -peerCertPath = ipsecPath "certs" . coerce . peerContactName +peerCertPath = ipsecPath "certs" . coerce . peerCertificateName makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter makeFileWriter p c = @@ -592,10 +592,10 @@ sshKeyToHostname sshkey = do " (read _ _ _ _ _ hash _ && echo -n $hash.ssh.cryptonomic.net); r=$?; rm -f \"$f\"; exit $r" peerConnectionName :: Peer -> Char8.ByteString -peerConnectionName = coerce . peerContactName +peerConnectionName = coerce . peerAddress peerCertificateName :: Peer -> Char8.ByteString -peerCertificateName = (<> ".pem") . peerConnectionName +peerCertificateName = (<> ".pem") . coerce . peerAddress peerAddress :: Peer -> Char8.ByteString peerAddress = Char8.pack . showA . addr -- cgit v1.2.3