diff options
author | Andrew Cady <d@jerkface.net> | 2019-07-13 05:12:32 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-07-13 06:27:06 -0400 |
commit | 94d2128963f28c0b02a282e5ab2a470275b7de1c (patch) | |
tree | dbc963b4ee3971dfdc38a362c1a41f6b9a6f8e07 /lib | |
parent | 142352043699520d3cc3f1c6f1ff4fba585014a8 (diff) |
remove redundant field
Diffstat (limited to 'lib')
-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 1cc387b..292197a 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs | |||
@@ -339,9 +339,10 @@ importAndRefresh root cmn cipher = do | |||
339 | data Peer = | 339 | data Peer = |
340 | Peer | 340 | Peer |
341 | { peerHostnames :: Hostnames | 341 | { peerHostnames :: Hostnames |
342 | , addr :: SockAddr | ||
343 | , kd :: KeyData | 342 | , kd :: KeyData |
344 | } | 343 | } |
344 | addr :: Peer -> SockAddr | ||
345 | addr = gpgipv6addr . peerHostnames | ||
345 | 346 | ||
346 | newtype IpsecPeerConfig = IpsecPeerConfig Char8.ByteString | 347 | newtype 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 | |||
558 | newtype ResolvableHostname = ResolvableHostname Char8.ByteString | 559 | newtype ResolvableHostname = ResolvableHostname Char8.ByteString |
559 | 560 | ||
560 | listPeers :: KeyRingRuntime -> [Peer] | 561 | listPeers :: KeyRingRuntime -> [Peer] |
561 | listPeers rt = map conv . filter notme . mapMaybe namedContact . Map.elems . byKeyKey . rtKeyDB $ rt | 562 | listPeers 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 | ||
571 | writePublicKeyFiles :: KeyRingRuntime -> FileWriter -> String -> MyIdentity -> IO () | 571 | writePublicKeyFiles :: KeyRingRuntime -> FileWriter -> String -> MyIdentity -> IO () |
572 | writePublicKeyFiles rt fw grip myId = do | 572 | writePublicKeyFiles rt fw grip myId = do |