summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Kiki.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs
index 1cc387b..292197a 100644
--- a/lib/Kiki.hs
+++ b/lib/Kiki.hs
@@ -339,9 +339,10 @@ importAndRefresh root cmn cipher = do
339data Peer = 339data Peer =
340 Peer 340 Peer
341 { peerHostnames :: Hostnames 341 { peerHostnames :: Hostnames
342 , addr :: SockAddr
343 , kd :: KeyData 342 , kd :: KeyData
344 } 343 }
344addr :: Peer -> SockAddr
345addr = gpgipv6addr . peerHostnames
345 346
346newtype IpsecPeerConfig = IpsecPeerConfig Char8.ByteString 347newtype IpsecPeerConfig = IpsecPeerConfig Char8.ByteString
347-- Installs the cert file for the peer to the filesystem, and returns an 348-- Installs the cert file for the peer to the filesystem, and returns an
@@ -558,15 +559,14 @@ newtype UidHostname = UidHostname Char8.ByteString
558newtype ResolvableHostname = ResolvableHostname Char8.ByteString 559newtype ResolvableHostname = ResolvableHostname Char8.ByteString
559 560
560listPeers :: KeyRingRuntime -> [Peer] 561listPeers :: KeyRingRuntime -> [Peer]
561listPeers rt = map conv . filter notme . mapMaybe namedContact . Map.elems . byKeyKey . rtKeyDB $ rt 562listPeers rt = map (uncurry Peer) . filter notme . mapMaybe namedContact . Map.elems . byKeyKey . rtKeyDB $ rt
562 where 563 where
563 conv = \(a,b,c) -> Peer a b c 564 kk = keykey (fromJust $ rtWorkingKey rt)
564 kk = keykey (fromJust $ rtWorkingKey rt) 565 notme (_,kd) = keykey (keyPacket kd) /= kk
565 notme (_,_,kd) = keykey (keyPacket kd) /= kk
566 namedContact kd = do 566 namedContact kd = do
567 let h = getHostnames kd 567 let h = getHostnames kd
568 _ <- listToMaybe $ allNames h 568 _ <- listToMaybe $ allNames h
569 return (h, gpgipv6addr h, kd) 569 return (h, kd)
570 570
571writePublicKeyFiles :: KeyRingRuntime -> FileWriter -> String -> MyIdentity -> IO () 571writePublicKeyFiles :: KeyRingRuntime -> FileWriter -> String -> MyIdentity -> IO ()
572writePublicKeyFiles rt fw grip myId = do 572writePublicKeyFiles rt fw grip myId = do