packages feed

hOpenPGP 2.7.4.1 → 2.8

raw patch · 6 files changed

+47/−33 lines, 6 files

Files

Codec/Encryption/OpenPGP/Internal.hs view
@@ -1,5 +1,5 @@ -- Internal.hs: private utility functions and such--- Copyright © 2012-2018  Clint Adams+-- Copyright © 2012-2019  Clint Adams -- This software is released under the terms of the Expat license. -- (See the LICENSE file). @@ -12,10 +12,6 @@  , emptyPSC  , pubkeyToMPIs  , multiplicativeInverse- , sigType- , sigPKA- , sigHA- , sigCT  , curveoidBSToCurve  , curveToCurveoidBS  , point2BS@@ -84,26 +80,6 @@ multiplicativeInverse _ 1 = 1 multiplicativeInverse q p = (n * q + 1) `div` p     where n = p - multiplicativeInverse p (q `mod` p)--sigType :: SignaturePayload -> Maybe SigType-sigType (SigV3 st _ _ _ _ _ _) = Just st-sigType (SigV4 st _ _ _ _ _ _) = Just st-sigType _ = Nothing -- this includes v2 sigs, which don't seem to be specified in the RFCs but exist in the wild--sigPKA :: SignaturePayload -> Maybe PubKeyAlgorithm-sigPKA (SigV3 _ _ _ pka _ _ _) = Just pka-sigPKA (SigV4 _ pka _ _ _ _ _) = Just pka-sigPKA _ = Nothing -- this includes v2 sigs, which don't seem to be specified in the RFCs but exist in the wild--sigHA :: SignaturePayload -> Maybe HashAlgorithm-sigHA (SigV3 _ _ _ _ ha _ _) = Just ha-sigHA (SigV4 _ _ ha _ _ _ _) = Just ha-sigHA _ = Nothing -- this includes v2 sigs, which don't seem to be specified in the RFCs but exist in the wild--sigCT :: SignaturePayload -> Maybe ThirtyTwoBitTimeStamp-sigCT (SigV3 _ ct _ _ _ _ _) = Just ct-sigCT (SigV4 _ _ _ hsubs _ _ _) = fmap (\(SigSubPacket _ (SigCreationTime i)) -> i) (find isSigCreationTime hsubs)-sigCT _ = Nothing  curveoidBSToCurve :: B.ByteString -> Either String ECCCurve curveoidBSToCurve oidbs
+ Codec/Encryption/OpenPGP/SignatureQualities.hs view
@@ -0,0 +1,36 @@+-- SignatureQualities.hs: OpenPGP (RFC4880) signature qualities+-- Copyright © 2012-2019  Clint Adams+-- This software is released under the terms of the Expat license.+-- (See the LICENSE file).++module Codec.Encryption.OpenPGP.SignatureQualities (+   sigType+ , sigPKA+ , sigHA+ , sigCT+) where++import Data.List (find)++import Codec.Encryption.OpenPGP.Ontology (isSigCreationTime)+import Codec.Encryption.OpenPGP.Types++sigType :: SignaturePayload -> Maybe SigType+sigType (SigV3 st _ _ _ _ _ _) = Just st+sigType (SigV4 st _ _ _ _ _ _) = Just st+sigType _ = Nothing -- this includes v2 sigs, which don't seem to be specified in the RFCs but exist in the wild++sigPKA :: SignaturePayload -> Maybe PubKeyAlgorithm+sigPKA (SigV3 _ _ _ pka _ _ _) = Just pka+sigPKA (SigV4 _ pka _ _ _ _ _) = Just pka+sigPKA _ = Nothing -- this includes v2 sigs, which don't seem to be specified in the RFCs but exist in the wild++sigHA :: SignaturePayload -> Maybe HashAlgorithm+sigHA (SigV3 _ _ _ _ ha _ _) = Just ha+sigHA (SigV4 _ _ ha _ _ _ _) = Just ha+sigHA _ = Nothing -- this includes v2 sigs, which don't seem to be specified in the RFCs but exist in the wild++sigCT :: SignaturePayload -> Maybe ThirtyTwoBitTimeStamp+sigCT (SigV3 _ ct _ _ _ _ _) = Just ct+sigCT (SigV4 _ _ _ hsubs _ _ _) = fmap (\(SigSubPacket _ (SigCreationTime i)) -> i) (find isSigCreationTime hsubs)+sigCT _ = Nothing
Codec/Encryption/OpenPGP/Signatures.hs view
@@ -1,5 +1,5 @@ -- Signatures.hs: OpenPGP (RFC4880) signature verification--- Copyright © 2012-2018  Clint Adams+-- Copyright © 2012-2019  Clint Adams -- This software is released under the terms of the Expat license. -- (See the LICENSE file). 
Codec/Encryption/OpenPGP/Types/Internal/PKITypes.hs view
@@ -1,5 +1,5 @@ -- PKITypes.hs: OpenPGP (RFC4880) data types for public/secret keys--- Copyright © 2012-2018  Clint Adams+-- Copyright © 2012-2019  Clint Adams -- This software is released under the terms of the Expat license. -- (See the LICENSE file). @@ -100,7 +100,7 @@     toJSON (ElGamalPrivateKey k) = A.toJSON k     toJSON (ECDHPrivateKey k) = A.toJSON k     toJSON (ECDSAPrivateKey k) = A.toJSON k-    toJSON (EdDSAPrivateKey c bs) = A.toJSON (c, (B.unpack bs))+    toJSON (EdDSAPrivateKey c bs) = A.toJSON (c, B.unpack bs)     toJSON (UnknownSKey bs) = A.toJSON (BL.unpack bs)  data PKPayload = PKPayload {
Data/Conduit/OpenPGP/Keyring/Instances.hs view
@@ -1,5 +1,5 @@ -- Instances.hs: OpenPGP (RFC4880) additional types for transferable keys--- Copyright © 2012-2016  Clint Adams+-- Copyright © 2012-2019  Clint Adams -- This software is released under the terms of the Expat license. -- (See the LICENSE file). @@ -11,7 +11,8 @@ ) where  import Codec.Encryption.OpenPGP.Fingerprint (eightOctetKeyID, fingerprint)-import Codec.Encryption.OpenPGP.Internal (issuer, sigCT)+import Codec.Encryption.OpenPGP.Internal (issuer)+import Codec.Encryption.OpenPGP.SignatureQualities (sigCT) import Codec.Encryption.OpenPGP.Types import Control.Lens ((^.), (^..), _1, folded) import Data.Data.Lens (biplate)
hOpenPGP.cabal view
@@ -1,5 +1,5 @@ Name:                hOpenPGP-Version:             2.7.4.1+Version:             2.8 Synopsis:            native Haskell implementation of OpenPGP (RFC4880) Description:         native Haskell implementation of OpenPGP (RFC4880), plus Camellia (RFC5581), plus ECC (RFC6637) 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 Extra-source-files: tests/suite.hs@@ -173,6 +173,7 @@                      , Codec.Encryption.OpenPGP.SecretKey                      , Codec.Encryption.OpenPGP.Serialize                      , Codec.Encryption.OpenPGP.Signatures+                     , Codec.Encryption.OpenPGP.SignatureQualities                      , Data.Conduit.OpenPGP.Compression                      , Data.Conduit.OpenPGP.Decrypt                      , Data.Conduit.OpenPGP.Filter@@ -342,4 +343,4 @@ source-repository this   type:     git   location: https://salsa.debian.org/clint/hOpenPGP.git-  tag:      v2.7.4.1+  tag:      v2.8