packages feed

hopenpgp-tools 0.21.2 → 0.21.3

raw patch · 9 files changed

+47/−46 lines, 9 filesdep ~base

Dependency ranges changed: base

Files

HOpenPGP/Tools/Common.hs view
@@ -1,5 +1,5 @@ -- Common.hs: hOpenPGP-tools common functions--- Copyright © 2012-2018  Clint Adams+-- Copyright © 2012-2019  Clint Adams -- -- vim: softtabstop=4:shiftwidth=4:expandtab --@@ -76,7 +76,7 @@ banner :: String -> Doc ann {-# INLINE banner #-} banner name = pretty name <+> pretty "(hopenpgp-tools)" <+> pretty (showVersion version) <> hardline-     <> pretty "Copyright (C) 2012-2018  Clint Adams"+     <> pretty "Copyright (C) 2012-2019  Clint Adams"  warranty :: String -> Doc ann {-# INLINE warranty #-}
HOpenPGP/Tools/HKP.hs view
@@ -1,5 +1,5 @@ -- HKP.hs: hOpenPGP key tool--- Copyright © 2016-2018  Clint Adams+-- Copyright © 2016-2019  Clint Adams -- -- vim: softtabstop=4:shiftwidth=4:expandtab --
HOpenPGP/Tools/TKUtils.hs view
@@ -1,5 +1,5 @@ -- TKUtils.hs: hOpenPGP-tools TK-related common functions--- Copyright © 2013-2018  Clint Adams+-- Copyright © 2013-2019  Clint Adams -- -- vim: softtabstop=4:shiftwidth=4:expandtab --@@ -26,9 +26,9 @@ import Control.Error.Util (hush) import Control.Arrow (second) import Control.Lens ((^.), _1)-import Data.List (sortBy)+import Data.List (sortOn) import Data.Maybe (mapMaybe, listToMaybe)-import Data.Ord (comparing, Down(..))+import Data.Ord (Down(..)) import Data.Time.Clock.POSIX (posixSecondsToUTCTime, POSIXTime)  -- should this fail or should verifyTKWith fail if there are no self-sigs?@@ -44,7 +44,7 @@             _tkUIDs = map (second newest) (_tkUIDs tk)           , _tkUAts = map (second newest) (_tkUAts tk)         }-        newest = take 1 . sortBy (comparing (Down . take 1 . sigcts)) -- FIXME: this is terrible+        newest = take 1 . sortOn (Down . take 1 . sigcts) -- FIXME: this is terrible         sigcts (SigV4 _ _ _ xs _ _ _) = map (\(SigSubPacket _ (SigCreationTime x)) -> x) $ filter isCT xs         alleged = filter (\x -> ((==) <$> sigissuer x <*> eoki (key^.tkKey._1)) == Just True)         isCT (SigSubPacket _ (SigCreationTime _)) = True
dist/build/hkt/hkt-tmp/HOpenPGP/Tools/Parser.hs view
@@ -1303,7 +1303,19 @@   {-# LINE 10 "<command-line>" #-}-{-# LINE 1 "/tmp/ghc6015_0/ghc_2.h" #-}+{-# LINE 1 "/tmp/ghc6091_0/ghc_2.h" #-}++++++++++++   
dist/build/hot/hot-tmp/HOpenPGP/Tools/Parser.hs view
@@ -1303,7 +1303,19 @@   {-# LINE 10 "<command-line>" #-}-{-# LINE 1 "/tmp/ghc6015_0/ghc_2.h" #-}+{-# LINE 1 "/tmp/ghc6091_0/ghc_2.h" #-}++++++++++++   
hkt.hs view
@@ -1,5 +1,5 @@ -- hkt.hs: hOpenPGP key tool--- Copyright © 2013-2018  Clint Adams+-- Copyright © 2013-2019  Clint Adams -- -- vim: softtabstop=4:shiftwidth=4:expandtab --@@ -16,7 +16,6 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program.  If not, see <http://www.gnu.org/licenses/>. -{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-}  import HOpenPGP.Tools.Common (banner, versioner, warranty, keyMatchesFingerprint, keyMatchesEightOctetKeyId, keyMatchesUIDSubString)@@ -27,9 +26,6 @@ import Codec.Encryption.OpenPGP.Serialize () import Codec.Encryption.OpenPGP.Signatures (verifyTKWith, verifySigWith, verifyAgainstKeyring) import Codec.Encryption.OpenPGP.Types-#if !MIN_VERSION_base(4,8,0)-import Control.Applicative ((<$>),(<*>), pure)-#endif import Control.Applicative (optional, (<|>)) import Control.Arrow ((&&&)) import Control.Lens ((^.), _1, _2, (^..))@@ -61,17 +57,11 @@ import Data.Map (Map) import qualified Data.Map as Map import Data.Maybe (fromMaybe, mapMaybe, listToMaybe)-#if !MIN_VERSION_base(4,8,0)-import Data.Monoid (mconcat)-#endif import Data.Monoid ((<>)) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy.IO as TLIO import Data.Time.Clock.POSIX (getPOSIXTime, posixSecondsToUTCTime)-#if !MIN_VERSION_base(4,8,0)-import Data.Traversable (traverse)-#endif import Data.Tuple (swap) import qualified Data.Yaml as Y import GHC.Generics@@ -105,7 +95,6 @@     keysize :: Maybe Int   , keyalgo :: String   , keyalgoabbreviation :: String-  , keyid :: String   , fpr :: String } deriving Generic @@ -128,7 +117,6 @@         mkey = Key <$> either (const Nothing) Just . pubkeySize . _pubkey                    <*> show . _pkalgo                    <*> pkalgoAbbrev . _pkalgo-                   <*> either (const "unknown") (show . pretty) . eightOctetKeyID                    <*> show . pretty . fingerprint  showTKey :: TKey -> IO ()@@ -138,7 +126,7 @@     mconcat (map (\x -> pretty "sub  " <+> sizeabbrevkeyid x <> hardline) (subkeys key)) <>     hardline     where-        sizeabbrevkeyid k = pretty (maybe "unknown" show (keysize k)) <> pretty (keyalgoabbreviation k) <> pretty "/0x" <> pretty (keyid k)+        sizeabbrevkeyid k = pretty (maybe "unknown" show (keysize k)) <> pretty (keyalgoabbreviation k) <> pretty "/" <> pretty (fpr k)  data Options = Options {     keyring :: String
hokey.hs view
@@ -1,5 +1,5 @@ -- hokey.hs: hOpenPGP key tool--- Copyright © 2013-2018  Clint Adams+-- Copyright © 2013-2019  Clint Adams -- -- vim: softtabstop=4:shiftwidth=4:expandtab --@@ -31,9 +31,6 @@ import Codec.Encryption.OpenPGP.Ontology (isCertRevocationSig, isCT, isKUF, isPHA, isPKBindingSig, isSKBindingSig) import Codec.Encryption.OpenPGP.Serialize () import Codec.Encryption.OpenPGP.Types-#if !MIN_VERSION_base(4,8,0)-import Control.Applicative ((<$>),(<*>), pure)-#endif import Control.Arrow ((***)) import Control.Error.Util (hush) import Control.Lens ((^.), (&), _1, _2, mapped, over)@@ -52,18 +49,15 @@ import qualified Data.Conduit.List as CL import Data.Conduit.OpenPGP.Keyring (conduitToTKsDropping) import Data.Foldable (find)-import Data.List (elemIndex, findIndex, nub, sort, sortBy, intercalate)+import Data.List (elemIndex, findIndex, nub, sort, sortOn, intercalate) import qualified Data.Map as Map import Data.Maybe (fromMaybe, mapMaybe, listToMaybe)-#if !MIN_VERSION_base(4,8,0)-import Data.Monoid (mconcat, Monoid(..))-#endif #if !MIN_VERSION_base(4,9,0) import Data.Monoid ((<>)) #else import Data.Semigroup ((<>), Semigroup) #endif-import Data.Ord (comparing, Down(..))+import Data.Ord (Down(..)) import qualified Data.Set as Set import Data.Text (Text) import qualified Data.Text as T@@ -236,7 +230,7 @@                                                      (findRevocationReason sps))         populateBestOf krep = Just (UIDReport <$> best . uidSelfSigHashAlgorithms <*> best . uidPreferredHashAlgorithms <*> best . uidKeyExpirationTimes <*> best . uidKeyUsageFlags <*> pure [] $ mconcat (justTheUIDRs krep))         justTheUIDRs = map (decolorize . snd) . unFakeMap . keyUIDsAndUAts-        best = take 1 . sortBy (comparing color)+        best = take 1 . sortOn color         decolorize (Colored _ _ x) = x         colorizeUID u             | '(' `elem` T.unpack u = Colored (Just Yellow) (Just "parenthesis in uid")  -- FIXME: be more discerning@@ -250,7 +244,7 @@         kufs s = map (colorizeKUFs s . (\(SigSubPacket _ (KeyFlags x)) -> x) . fromMaybe undefined . find isKUF . hasheds) . newestWith (any isKUF . hasheds)         colorizeKUFs False x = uncurry Colored (if (Set.member EncryptStorageKey x || Set.member EncryptCommunicationsKey x) && (Set.member SignDataKey x || Set.member CertifyKeysKey x) then (Just Yellow, Just "both signing & encryption") else (Just Green, Nothing)) x         colorizeKUFs True x = uncurry Colored (if Set.member CertifyKeysKey x then (Just Red, Just "certification-capable subkey") else (if (Set.member EncryptStorageKey x || Set.member EncryptCommunicationsKey x) && Set.member SignDataKey x then (Just Yellow, Just "both signing & encryption") else (Just Green, Nothing))) x-        newestWith p = take 1 . sortBy (comparing (Down . take 1 . sigcts)) . filter p -- FIXME: this is terrible+        newestWith p = take 1 . sortOn (Down . take 1 . sigcts) . filter p -- FIXME: this is terrible         hasheds (SigV4 _ _ _ xs _ _ _) = xs         hasheds _ = []         checkSK :: TwentyOctetFingerprint -> (Pkt, [SignaturePayload]) -> SubkeyReport
hopenpgp-tools.cabal view
@@ -1,5 +1,5 @@ name:                hopenpgp-tools-version:             0.21.2+version:             0.21.3 synopsis:            hOpenPGP-based command-line tools description:         command-line tools for performing some OpenPGP-related operations homepage:            https://salsa.debian.org/clint/hOpenPGP@@ -7,7 +7,7 @@ license-file:        LICENSE author:              Clint Adams maintainer:          Clint Adams <clint@debian.org>-copyright:           2012-2018 Clint Adams+copyright:           2012-2019 Clint Adams category:            Codec, Data build-type:          Simple cabal-version:       >=1.10@@ -18,7 +18,7 @@   other-modules:       HOpenPGP.Tools.Common                ,       HOpenPGP.Tools.Lexer                ,       HOpenPGP.Tools.Parser-  build-depends:       base                   > 4         && < 5+  build-depends:       base                   > 4.8       && < 5                ,       aeson                ,       array                ,       binary                 >= 0.6.4.0@@ -47,7 +47,7 @@   other-modules:       HOpenPGP.Tools.Common                ,       HOpenPGP.Tools.HKP                ,       HOpenPGP.Tools.TKUtils-  build-depends:       base                   > 4         && < 5+  build-depends:       base                   > 4.8       && < 5                ,       aeson                ,       base16-bytestring                ,       binary                 >= 0.6.4.0@@ -85,7 +85,7 @@   other-modules:       HOpenPGP.Tools.Common                ,       HOpenPGP.Tools.Lexer                ,       HOpenPGP.Tools.Parser-  build-depends:       base                   > 4         && < 5+  build-depends:       base                   > 4.8       && < 5                ,       aeson                ,       array                ,       attoparsec             >= 0.10.0.0@@ -124,4 +124,4 @@ source-repository this   type:     git   location: https://salsa.debian.org/clint/hOpenPGP.git-  tag:      hopenpgp-tools/0.21.2+  tag:      hopenpgp-tools/0.21.3
hot.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE RecordWildCards #-}  -- hot.hs: hOpenPGP Tool--- Copyright © 2012-2018  Clint Adams+-- Copyright © 2012-2019  Clint Adams -- -- vim: softtabstop=4:shiftwidth=4:expandtab --@@ -18,8 +18,6 @@ -- You should have received a copy of the GNU Affero General Public License -- along with this program.  If not, see <http://www.gnu.org/licenses/>. -{-# LANGUAGE CPP #-}- import Paths_hopenpgp_tools (version) import HOpenPGP.Tools.Common (banner, versioner, warranty, prependAuto) import HOpenPGP.Tools.Parser (parsePExp)@@ -27,9 +25,6 @@ import Codec.Encryption.OpenPGP.ASCIIArmor.Types (Armor(..), ArmorType(..)) import Codec.Encryption.OpenPGP.Serialize () import Codec.Encryption.OpenPGP.Types-#if !MIN_VERSION_base(4,8,0)-import Control.Applicative ((<$>), (<*>), pure)-#endif import Control.Applicative (optional) import Control.Error.Util (note) import Control.Monad.IO.Class (MonadIO, liftIO)