diff options
author | Andrew Cady <d@jerkface.net> | 2019-07-13 00:57:31 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2019-07-13 00:57:31 -0400 |
commit | 674b7464b74cc1bfe6f609f833af406300828295 (patch) | |
tree | c668bec089c9d19b002bdef815938a51aa251475 /lib/KeyRing/BuildKeyDB.hs | |
parent | db7738d3d3ea80011fdf6f355d1f06009214e032 (diff) |
factor out chooseOneName
Diffstat (limited to 'lib/KeyRing/BuildKeyDB.hs')
-rw-r--r-- | lib/KeyRing/BuildKeyDB.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs index c5754f1..0a90cbc 100644 --- a/lib/KeyRing/BuildKeyDB.hs +++ b/lib/KeyRing/BuildKeyDB.hs | |||
@@ -973,16 +973,15 @@ setHostnames (IPsToWriteToHostsFile outgoing_names) hosts kd@(KeyData topmp tops | |||
973 | return $ KeyData topmp topsigs uids1 subs | 973 | return $ KeyData topmp topsigs uids1 subs |
974 | where | 974 | where |
975 | pred = addr `elem` outgoing_names | 975 | pred = addr `elem` outgoing_names |
976 | topk = packet topmp | 976 | addr = fingerdress $ packet topmp |
977 | addr = fingerdress topk | ||
978 | names :: [Char8.ByteString] | 977 | names :: [Char8.ByteString] |
979 | names = Hosts.namesForAddress addr hosts | 978 | names = Hosts.namesForAddress addr hosts |
980 | pred2 = gotNonOnions == namesWithoutGotOnions | 979 | pred2 = gotNonOnions == namesWithoutGotOnions |
981 | 980 | ||
982 | Hostnames _ gotOnions gotNonOnions cryptonomic = getHostnames kd | 981 | Hostnames _ gotOnions gotNonOnions cryptonomic = getHostnames kd |
983 | 982 | ||
984 | namesWithoutGotOnions = names \\ gotOnions | 983 | namesWithoutGotOnions = names \\ gotOnions |
985 | notations = map (NotationDataPacket True "hostname@" . Char8.unpack) namesWithoutGotOnions | 984 | notations = map (NotationDataPacket True "hostname@" . Char8.unpack) namesWithoutGotOnions |
986 | isName (NotationDataPacket True "hostname@" _) = True | 985 | isName (NotationDataPacket True "hostname@" _) = True |
987 | isName _ = False | 986 | isName _ = False |
988 | uids0 = fmap zapIfHasName uids | 987 | uids0 = fmap zapIfHasName uids |