packages feed

hOpenPGP 0.7 → 0.8

raw patch · 16 files changed

+90/−24 lines, 16 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Codec.Encryption.OpenPGP.KeyInfo: keySize :: PKey -> Int
+ Codec.Encryption.OpenPGP.KeyInfo: pkalgoAbbrev :: PubKeyAlgorithm -> [Char]
+ Codec.Encryption.OpenPGP.S2K: string2Key :: Integral a => S2K -> a -> ByteString -> ByteString

Files

Codec/Encryption/OpenPGP/Compression.hs view
@@ -1,6 +1,6 @@ -- Compression.hs: OpenPGP (RFC4880) compression and decompression -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Codec.Encryption.OpenPGP.Compression (
Codec/Encryption/OpenPGP/Fingerprint.hs view
@@ -1,6 +1,6 @@ -- Fingerprint.hs: OpenPGP (RFC4880) fingerprinting methods -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Codec.Encryption.OpenPGP.Fingerprint (
Codec/Encryption/OpenPGP/Internal.hs view
@@ -1,6 +1,6 @@ -- Internal.hs: private utility functions -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Codec.Encryption.OpenPGP.Internal (
+ Codec/Encryption/OpenPGP/KeyInfo.hs view
@@ -0,0 +1,36 @@+-- KeyInfo.hs: OpenPGP (RFC4880) fingerprinting methods+-- Copyright © 2012-2013  Clint Adams+-- This software is released under the terms of the Expat license.+-- (See the LICENSE file).++module Codec.Encryption.OpenPGP.KeyInfo (+   keySize+ , pkalgoAbbrev+) where++import qualified Crypto.PubKey.RSA as RSA+import qualified Crypto.PubKey.DSA as DSA+import qualified Crypto.Hash.MD5 as MD5+import qualified Crypto.Hash.SHA1 as SHA1+import qualified Data.ByteString as B+import Data.Bits (shiftR)+import Data.List (unfoldr)++import Codec.Encryption.OpenPGP.Types++keySize (RSAPubKey x) = RSA.public_size x * 8+keySize (DSAPubKey x) = bitcount . DSA.params_p . DSA.public_params $ x+keySize (ElGamalPubKey x) = bitcount $ x !! 0++bitcount = (*8) . length . unfoldr (\x -> if x == 0 then Nothing else Just (True, x `shiftR` 8))++pkalgoAbbrev RSA = "R"+pkalgoAbbrev DSA = "D"+pkalgoAbbrev ElgamalEncryptOnly = "g"+pkalgoAbbrev DeprecatedRSAEncryptOnly = "-"+pkalgoAbbrev DeprecatedRSASignOnly = "_"+pkalgoAbbrev EC = "e"+pkalgoAbbrev ECDSA = "E"+pkalgoAbbrev ForbiddenElgamal = "f"+pkalgoAbbrev DH = "d"+pkalgoAbbrev (OtherPKA _) = "."
+ Codec/Encryption/OpenPGP/S2K.hs view
@@ -0,0 +1,21 @@+-- S2K.hs: OpenPGP (RFC4880) string-to-key conversion+-- Copyright © 2013  Clint Adams+-- This software is released under the terms of the Expat license.+-- (See the LICENSE file).++module Codec.Encryption.OpenPGP.S2K (+  string2Key+) where++import Codec.Encryption.OpenPGP.Types+import qualified Crypto.Hash.SHA1 as SHA1+import qualified Data.ByteString as B+import qualified Data.ByteString.Lazy as BL++string2Key :: Integral a => S2K -> a -> BL.ByteString -> B.ByteString+string2Key (Simple SHA1) ksz bs+    | 20 < ksz = error "FIXME"+    | otherwise = B.take (fromIntegral ksz) . SHA1.hashlazy $ bs+string2Key (Salted SHA1 salt) ksz bs = string2Key (Simple SHA1) ksz (BL.append (BL.fromChunks [salt]) bs)+string2Key (IteratedSalted SHA1 salt cnt) ksz bs = string2Key (Simple SHA1) ksz (BL.take (fromIntegral cnt) . BL.cycle $ BL.append (BL.fromChunks [salt]) bs)+string2Key _ _ _ = error "FIXME"
Codec/Encryption/OpenPGP/Serialize.hs view
@@ -1,6 +1,6 @@ -- Serialize.hs: OpenPGP (RFC4880) serialization (using cereal) -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Codec.Encryption.OpenPGP.Serialize (
Codec/Encryption/OpenPGP/SerializeForSigs.hs view
@@ -1,6 +1,6 @@ -- SerializeForSigs.hs: OpenPGP (RFC4880) special serialization for signature purposes -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Codec.Encryption.OpenPGP.SerializeForSigs (
Codec/Encryption/OpenPGP/Signatures.hs view
@@ -1,6 +1,6 @@ -- Verify.hs: OpenPGP (RFC4880) signature verification -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Codec.Encryption.OpenPGP.Signatures (
Codec/Encryption/OpenPGP/Types.hs view
@@ -1,6 +1,6 @@ -- Types.hs: OpenPGP (RFC4880) data types -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  {-# LANGUAGE DeriveDataTypeable, ExistentialQuantification, TemplateHaskell, TypeFamilies #-}
Data/Conduit/OpenPGP/Compression.hs view
@@ -1,6 +1,6 @@ -- Compression.hs: OpenPGP (RFC4880) compression conduits -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Data.Conduit.OpenPGP.Compression (
Data/Conduit/OpenPGP/Keyring.hs view
@@ -1,6 +1,6 @@ -- Keyring.hs: OpenPGP (RFC4880) transferable keys parsing -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Data.Conduit.OpenPGP.Keyring (
Data/Conduit/OpenPGP/Keyring/Instances.hs view
@@ -1,6 +1,6 @@ -- Instances.hs: OpenPGP (RFC4880) additional types for transferable keys -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Data.Conduit.OpenPGP.Keyring.Instances (
Data/Conduit/OpenPGP/Verify.hs view
@@ -1,6 +1,6 @@ -- Verify.hs: OpenPGP (RFC4880) signature verification -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  module Data.Conduit.OpenPGP.Verify (
LICENSE view
@@ -1,13 +1,20 @@ Copyright © 2012-2013 Clint Adams <clint@debian.org> -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies.+Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:  -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE.+The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software. ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
hOpenPGP.cabal view
@@ -1,9 +1,9 @@ Name:                hOpenPGP-Version:             0.7+Version:             0.8 Synopsis:            native Haskell implementation of OpenPGP (RFC4880) Description:         native Haskell implementation of OpenPGP (RFC4880) Homepage:            http://floss.scru.org/hOpenPGP/-License:             OtherLicense+License:             MIT License-file:        LICENSE Author:              Clint Adams Maintainer:          Clint Adams <clint@debian.org>@@ -120,6 +120,8 @@                      , Codec.Encryption.OpenPGP.Serialize                      , Codec.Encryption.OpenPGP.Compression                      , Codec.Encryption.OpenPGP.Fingerprint+                     , Codec.Encryption.OpenPGP.KeyInfo+                     , Codec.Encryption.OpenPGP.S2K                      , Codec.Encryption.OpenPGP.Signatures                      , Data.Conduit.OpenPGP.Compression                      , Data.Conduit.OpenPGP.Keyring
tests/suite.hs view
@@ -2,7 +2,7 @@  -- suite.hs: hOpenPGP test suite -- Copyright © 2012-2013  Clint Adams--- This software is released under the terms of the ISC license.+-- This software is released under the terms of the Expat license. -- (See the LICENSE file).  import Test.Framework (defaultMain, testGroup, Test)