summaryrefslogtreecommitdiffhomepage
path: root/Gpg
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-04 18:51:36 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-04 18:58:31 -0400
commit699687f503c63541a6e28501fa5f523b89c1915b (patch)
treef74fd9da7533b744d33bae9a714403d985047fad /Gpg
parente8f408e6456ac445c53fe50594ee0effc136f86c (diff)
downloaddebug-me-699687f503c63541a6e28501fa5f523b89c1915b.tar.gz
sanitize gpg output and chat messages
Just in case, only allow printable characters in this, not control characters.
Diffstat (limited to 'Gpg')
-rw-r--r--Gpg/Wot.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Gpg/Wot.hs b/Gpg/Wot.hs
index f9051e9..b29ccc7 100644
--- a/Gpg/Wot.hs
+++ b/Gpg/Wot.hs
@@ -95,10 +95,10 @@ isInStrongSet :: GpgKeyId -> IO StrongSetAnalysis
isInStrongSet k = maybe (StrongSetAnalysis False) (const $ StrongSetAnalysis True)
<$> downloadWotPath k knownKeyInStrongSet
-describeWot :: Maybe WotStats -> StrongSetAnalysis -> String
+describeWot :: Maybe WotStats -> StrongSetAnalysis -> [String]
describeWot (Just ws) (StrongSetAnalysis ss)
- | ss == False = theirname ++ "'s identity cannot be verified!"
- | otherwise = unlines $
+ | ss == False = [theirname ++ "'s identity cannot be verified!"]
+ | otherwise =
[ theirname ++ "'s identity has been verified by as many as "
++ show (length sigs) ++ " people, including:"
, intercalate ", " $ take 10 $ nub $
@@ -110,7 +110,7 @@ describeWot (Just ws) (StrongSetAnalysis ss)
theirname = stripEmail (uid (key ws))
sigs = cross_sigs ws ++ other_sigs ws
bestconnectedsigs = sortOn rank sigs
-describeWot Nothing _ = unlines
+describeWot Nothing _ =
[ ""
, "Their identity cannot be verified!"
]