diff options
Diffstat (limited to 'lib/KeyRing')
-rw-r--r-- | lib/KeyRing/BuildKeyDB.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs index 587d812..90f7292 100644 --- a/lib/KeyRing/BuildKeyDB.hs +++ b/lib/KeyRing/BuildKeyDB.hs | |||
@@ -2,6 +2,7 @@ | |||
2 | {-# LANGUAGE DoAndIfThenElse #-} | 2 | {-# LANGUAGE DoAndIfThenElse #-} |
3 | {-# LANGUAGE ForeignFunctionInterface #-} | 3 | {-# LANGUAGE ForeignFunctionInterface #-} |
4 | {-# LANGUAGE LambdaCase #-} | 4 | {-# LANGUAGE LambdaCase #-} |
5 | {-# LANGUAGE NamedFieldPuns #-} | ||
5 | {-# LANGUAGE OverloadedStrings #-} | 6 | {-# LANGUAGE OverloadedStrings #-} |
6 | {-# LANGUAGE PatternGuards #-} | 7 | {-# LANGUAGE PatternGuards #-} |
7 | {-# LANGUAGE TupleSections #-} | 8 | {-# LANGUAGE TupleSections #-} |
@@ -550,10 +551,7 @@ mergeHostFiles krd db ctx = do | |||
550 | hostdbs0 <- mapM (fmap Hosts.decode . readInputFileL' ctx) hns | 551 | hostdbs0 <- mapM (fmap Hosts.decode . readInputFileL' ctx) hns |
551 | 552 | ||
552 | let gpgnames = map getHostnames $ keyData db | 553 | let gpgnames = map getHostnames $ keyData db |
553 | os = do | 554 | os = concat $ allNames' <$> gpgnames |
554 | Hostnames addr ns _ _ <- gpgnames | ||
555 | n <- ns | ||
556 | return (addr,n) | ||
557 | setOnions hosts = foldl' (flip $ uncurry Hosts.assignName) hosts os | 555 | setOnions hosts = foldl' (flip $ uncurry Hosts.assignName) hosts os |
558 | -- we ensure .onion names are set properly | 556 | -- we ensure .onion names are set properly |
559 | hostdbs = map setOnions hostdbs0 | 557 | hostdbs = map setOnions hostdbs0 |
@@ -864,6 +862,12 @@ generateSubkey transcode kd' (genparam,StreamInfo { spill = KF_Match tag }) = do | |||
864 | return $ KikiSuccess (kd,report0) | 862 | return $ KikiSuccess (kd,report0) |
865 | generateSubkey _ kd _ = return kd | 863 | generateSubkey _ kd _ = return kd |
866 | 864 | ||
865 | allNames :: Hostnames -> [Char8.ByteString] | ||
866 | allNames (Hostnames _ ns os cs) = ns ++ os ++ (maybe [] return cs) | ||
867 | |||
868 | allNames' :: Hostnames -> [(SockAddr, Char8.ByteString)] | ||
869 | allNames' h@Hostnames{gpgipv6addr} = (gpgipv6addr,) <$> allNames h | ||
870 | |||
867 | data Hostnames = Hostnames { | 871 | data Hostnames = Hostnames { |
868 | gpgipv6addr :: SockAddr, | 872 | gpgipv6addr :: SockAddr, |
869 | verifiedOnionNames :: [L.ByteString], | 873 | verifiedOnionNames :: [L.ByteString], |