summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Arbitrary.patch4
-rw-r--r--Data/OpenPGP.hs5
2 files changed, 7 insertions, 2 deletions
diff --git a/Arbitrary.patch b/Arbitrary.patch
index b003906..9c753cb 100644
--- a/Arbitrary.patch
+++ b/Arbitrary.patch
@@ -21,8 +21,8 @@
21 21
22 _ -> error "FATAL ERROR: Arbitrary instance, logic bug" 22 _ -> error "FATAL ERROR: Arbitrary instance, logic bug"
23@@ -140 +139 @@ 23@@ -140 +139 @@
24- 6 -> do x1 <- arbitrary 24- 7 -> do x1 <- arbitrary
25+ 6 -> do x1 <- fmap (map toUpper . (`showHex` "")) (arbitrary :: Gen Word64) 25+ 7 -> do x1 <- fmap (map toUpper . (`showHex` "")) (arbitrary :: Gen Word64)
26@@ -143,2 +142 @@ 26@@ -143,2 +142 @@
27- x2 <- arbitrary 27- x2 <- arbitrary
28- return (UnsupportedSignatureSubpacket x1 x2) 28- return (UnsupportedSignatureSubpacket x1 x2)
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs
index b9a4836..acf5fb6 100644
--- a/Data/OpenPGP.hs
+++ b/Data/OpenPGP.hs
@@ -660,6 +660,7 @@ data SignatureSubpacket =
660 TrustSignaturePacket {depth::Word8, trust::Word8} | 660 TrustSignaturePacket {depth::Word8, trust::Word8} |
661 RegularExpressionPacket String | 661 RegularExpressionPacket String |
662 RevocablePacket Bool | 662 RevocablePacket Bool |
663 KeyExpirationTimePacket Word32 | -- seconds after key CreationTime
663 IssuerPacket String | 664 IssuerPacket String |
664 UnsupportedSignatureSubpacket Word8 B.ByteString 665 UnsupportedSignatureSubpacket Word8 B.ByteString
665 deriving (Show, Read, Eq) 666 deriving (Show, Read, Eq)
@@ -705,6 +706,8 @@ put_signature_subpacket (RegularExpressionPacket regex) =
705 (B.concat [B.fromString regex, B.singleton 0], 6) 706 (B.concat [B.fromString regex, B.singleton 0], 6)
706put_signature_subpacket (RevocablePacket exportable) = 707put_signature_subpacket (RevocablePacket exportable) =
707 (encode $ enum_to_word8 exportable, 7) 708 (encode $ enum_to_word8 exportable, 7)
709put_signature_subpacket (KeyExpirationTimePacket time) =
710 (encode time, 9)
708put_signature_subpacket (IssuerPacket keyid) = 711put_signature_subpacket (IssuerPacket keyid) =
709 (encode (fst $ head $ readHex keyid :: Word64), 16) 712 (encode (fst $ head $ readHex keyid :: Word64), 16)
710put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = 713put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) =
@@ -726,6 +729,8 @@ parse_signature_subpacket 6 = fmap
726-- RevocablePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.12 729-- RevocablePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.12
727parse_signature_subpacket 7 = 730parse_signature_subpacket 7 =
728 fmap (RevocablePacket . enum_from_word8) get 731 fmap (RevocablePacket . enum_from_word8) get
732-- KeyExpirationTimePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.6
733parse_signature_subpacket 9 = fmap KeyExpirationTimePacket get
729-- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 734-- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5
730parse_signature_subpacket 16 = do 735parse_signature_subpacket 16 = do
731 keyid <- get :: Get Word64 736 keyid <- get :: Get Word64