summaryrefslogtreecommitdiff
path: root/lib/KeyRing
diff options
context:
space:
mode:
Diffstat (limited to 'lib/KeyRing')
-rw-r--r--lib/KeyRing/BuildKeyDB.hs12
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)
865generateSubkey _ kd _ = return kd 863generateSubkey _ kd _ = return kd
866 864
865allNames :: Hostnames -> [Char8.ByteString]
866allNames (Hostnames _ ns os cs) = ns ++ os ++ (maybe [] return cs)
867
868allNames' :: Hostnames -> [(SockAddr, Char8.ByteString)]
869allNames' h@Hostnames{gpgipv6addr} = (gpgipv6addr,) <$> allNames h
870
867data Hostnames = Hostnames { 871data Hostnames = Hostnames {
868 gpgipv6addr :: SockAddr, 872 gpgipv6addr :: SockAddr,
869 verifiedOnionNames :: [L.ByteString], 873 verifiedOnionNames :: [L.ByteString],