diff options
author | Andrew Cady <d@jerkface.net> | 2019-07-13 01:23:06 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-07-13 01:23:06 -0400 |
commit | e9b27cd124d23a6e0d9e3b383827820d4ceafbeb (patch) | |
tree | f0c1415244a6ae60cad7684c0852757ca0d71e25 /lib/Kiki.hs | |
parent | 674b7464b74cc1bfe6f609f833af406300828295 (diff) |
use gpg address instead of .onion name in strongswan config
Diffstat (limited to 'lib/Kiki.hs')
-rw-r--r-- | lib/Kiki.hs | 12 |
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 | ||
375 | ipsecPath :: String -> Char8.ByteString -> String | 375 | ipsecPath :: String -> Char8.ByteString -> String |
376 | ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName ++ ".pem" | 376 | ipsecPath theDirName theBaseName = "ipsec.d/" ++ theDirName ++ "/" ++ Char8.unpack theBaseName |
377 | 377 | ||
378 | ipsecKeyPath :: MyIdentity -> FilePath | 378 | ipsecKeyPath :: MyIdentity -> FilePath |
379 | ipsecKeyPath (MyIdentity _ theBaseName) = ipsecPath "private" theBaseName | 379 | ipsecKeyPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "private" (addr <> ".pem") |
380 | 380 | ||
381 | ipsecCertPath :: MyIdentity -> FilePath | 381 | ipsecCertPath :: MyIdentity -> FilePath |
382 | ipsecCertPath (MyIdentity _ theBaseName) = ipsecPath "certs" theBaseName | 382 | ipsecCertPath (MyIdentity (Char8.pack . showA -> addr) _) = ipsecPath "certs" (addr <> ".pem") |
383 | 383 | ||
384 | peerCertPath :: Peer -> FilePath | 384 | peerCertPath :: Peer -> FilePath |
385 | peerCertPath = ipsecPath "certs" . coerce . peerContactName | 385 | peerCertPath = ipsecPath "certs" . coerce . peerCertificateName |
386 | 386 | ||
387 | makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter | 387 | makeFileWriter :: (FilePath -> FilePath) -> (IO ()) -> FileWriter |
388 | makeFileWriter p c = | 388 | makeFileWriter 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 | ||
594 | peerConnectionName :: Peer -> Char8.ByteString | 594 | peerConnectionName :: Peer -> Char8.ByteString |
595 | peerConnectionName = coerce . peerContactName | 595 | peerConnectionName = coerce . peerAddress |
596 | 596 | ||
597 | peerCertificateName :: Peer -> Char8.ByteString | 597 | peerCertificateName :: Peer -> Char8.ByteString |
598 | peerCertificateName = (<> ".pem") . peerConnectionName | 598 | peerCertificateName = (<> ".pem") . coerce . peerAddress |
599 | 599 | ||
600 | peerAddress :: Peer -> Char8.ByteString | 600 | peerAddress :: Peer -> Char8.ByteString |
601 | peerAddress = Char8.pack . showA . addr | 601 | peerAddress = Char8.pack . showA . addr |