summaryrefslogtreecommitdiff
path: root/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs')
-rw-r--r--Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs b/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs
index 2383ff3..64f7236 100644
--- a/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs
+++ b/Codec/Encryption/OpenPGP/ASCIIArmor/Decode.hs
@@ -9,7 +9,7 @@ module Codec.Encryption.OpenPGP.ASCIIArmor.Decode (
9 , decodeArmor 9 , decodeArmor
10) where 10) where
11 11
12import Codec.Encryption.OpenPGP.Serialize (getPackets) 12import Codec.Encryption.OpenPGP.Serialize ()
13import Codec.Encryption.OpenPGP.Types 13import Codec.Encryption.OpenPGP.Types
14import Control.Applicative (many, (<|>), (<$>)) 14import Control.Applicative (many, (<|>), (<$>))
15import Data.Attoparsec.ByteString (Parser, many1, string, inClass, notInClass, satisfy, word8, (<?>), parse, IResult(..)) 15import Data.Attoparsec.ByteString (Parser, many1, string, inClass, notInClass, satisfy, word8, (<?>), parse, IResult(..))
@@ -20,6 +20,7 @@ import qualified Data.ByteString as B
20import qualified Data.ByteString.Char8 as BC8 20import qualified Data.ByteString.Char8 as BC8
21import qualified Data.ByteString.Base64 as Base64 21import qualified Data.ByteString.Base64 as Base64
22import Data.Digest.CRC24 (crc24) 22import Data.Digest.CRC24 (crc24)
23import Data.Serialize (get)
23import Data.Serialize.Get (Get, runGet, getWord8) 24import Data.Serialize.Get (Get, runGet, getWord8)
24import Data.Serialize.Put (runPut, putWord32be) 25import Data.Serialize.Put (runPut, putWord32be)
25import Data.String (IsString, fromString) 26import Data.String (IsString, fromString)
@@ -38,9 +39,9 @@ parseArmor = do
38 blankishLine <?> "blank line" 39 blankishLine <?> "blank line"
39 payload <- base64Data <?> "base64 data" 40 payload <- base64Data <?> "base64 data"
40 endLine atype <?> "end line" 41 endLine atype <?> "end line"
41 case runGet getPackets payload of 42 case runGet get payload of
42 Left err -> fail err 43 Left err -> fail err
43 Right packets -> return $ Armor atype headers packets 44 Right packets -> return $ Armor atype headers (unBlock packets)
44 45
45beginLine :: (Integral a, Read a, Show a) => Parser (ArmorType a) 46beginLine :: (Integral a, Read a, Show a) => Parser (ArmorType a)
46beginLine = do 47beginLine = do