summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-07-13 01:23:06 -0400
committerAndrew Cady <d@jerkface.net>2019-07-13 01:23:06 -0400
commite9b27cd124d23a6e0d9e3b383827820d4ceafbeb (patch)
treef0c1415244a6ae60cad7684c0852757ca0d71e25
parent674b7464b74cc1bfe6f609f833af406300828295 (diff)
use gpg address instead of .onion name in strongswan config
-rw-r--r--lib/Kiki.hs12
1 files 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 <$>
373 $ getSubkeys CrossSigned their_master (keySubKeys kd) "ssh-server" 373 $ getSubkeys CrossSigned their_master (keySubKeys kd) "ssh-server"
374 374
375ipsecPath :: String -> Char8.ByteString -> String 375ipsecPath :: String -> Char8.ByteString -> String
376ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName ++ ".pem" 376ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName
377 377
378ipsecKeyPath :: MyIdentity -> FilePath 378ipsecKeyPath :: MyIdentity -> FilePath
379ipsecKeyPath (MyIdentity _ theBaseName) = ipsecPath "private" theBaseName 379ipsecKeyPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "private" (addr <> ".pem")
380 380
381ipsecCertPath :: MyIdentity -> FilePath 381ipsecCertPath :: MyIdentity -> FilePath
382ipsecCertPath (MyIdentity _ theBaseName) = ipsecPath "certs" theBaseName 382ipsecCertPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "certs" (addr <> ".pem")
383 383
384peerCertPath :: Peer -> FilePath 384peerCertPath :: Peer -> FilePath
385peerCertPath = ipsecPath "certs" . coerce . peerContactName 385peerCertPath = ipsecPath "certs" . coerce . peerCertificateName
386 386
387makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter 387makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter
388makeFileWriter p c = 388makeFileWriter p c =
@@ -592,10 +592,10 @@ sshKeyToHostname sshkey = do
592 " (read _ _ _ _ _ hash _ && echo -n $hash.ssh.cryptonomic.net); r=$?; rm -f \"$f\"; exit $r" 592 " (read _ _ _ _ _ hash _ && echo -n $hash.ssh.cryptonomic.net); r=$?; rm -f \"$f\"; exit $r"
593 593
594peerConnectionName :: Peer -> Char8.ByteString 594peerConnectionName :: Peer -> Char8.ByteString
595peerConnectionName = coerce . peerContactName 595peerConnectionName = coerce . peerAddress
596 596
597peerCertificateName :: Peer -> Char8.ByteString 597peerCertificateName :: Peer -> Char8.ByteString
598peerCertificateName = (<> ".pem") . peerConnectionName 598peerCertificateName = (<> ".pem") . coerce . peerAddress
599 599
600peerAddress :: Peer -> Char8.ByteString 600peerAddress :: Peer -> Char8.ByteString
601peerAddress = Char8.pack . showA . addr 601peerAddress = Char8.pack . showA . addr