summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-07-13 05:12:32 -0400
committerAndrew Cady <d@jerkface.net>2019-07-13 06:27:06 -0400
commit94d2128963f28c0b02a282e5ab2a470275b7de1c (patch)
treedbc963b4ee3971dfdc38a362c1a41f6b9a6f8e07
parent142352043699520d3cc3f1c6f1ff4fba585014a8 (diff)
remove redundant field
-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