diff options
-rw-r--r-- | Arbitrary.patch | 4 | ||||
-rw-r--r-- | Data/OpenPGP.hs | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Arbitrary.patch b/Arbitrary.patch index 6d855f1..8de13ad 100644 --- a/Arbitrary.patch +++ b/Arbitrary.patch | |||
@@ -30,8 +30,8 @@ | |||
30 | 30 | ||
31 | _ -> error "FATAL ERROR: Arbitrary instance, logic bug" | 31 | _ -> error "FATAL ERROR: Arbitrary instance, logic bug" |
32 | @@ -140 +139 @@ | 32 | @@ -140 +139 @@ |
33 | - 7 -> do x1 <- arbitrary | 33 | - 8 -> do x1 <- arbitrary |
34 | + 7 -> do x1 <- fmap (map toUpper . (`showHex` "")) (arbitrary :: Gen Word64) | 34 | + 8 -> do x1 <- fmap (map toUpper . (`showHex` "")) (arbitrary :: Gen Word64) |
35 | @@ -143,2 +142 @@ | 35 | @@ -143,2 +142 @@ |
36 | - x2 <- arbitrary | 36 | - x2 <- arbitrary |
37 | - return (UnsupportedSignatureSubpacket x1 x2) | 37 | - return (UnsupportedSignatureSubpacket x1 x2) |
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 878fb99..3534ccf 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -691,6 +691,7 @@ data SignatureSubpacket = | |||
691 | RegularExpressionPacket String | | 691 | RegularExpressionPacket String | |
692 | RevocablePacket Bool | | 692 | RevocablePacket Bool | |
693 | KeyExpirationTimePacket Word32 | -- seconds after key CreationTime | 693 | KeyExpirationTimePacket Word32 | -- seconds after key CreationTime |
694 | PreferredSymmetricAlgorithmsPacket [SymmetricAlgorithm] | | ||
694 | IssuerPacket String | | 695 | IssuerPacket String | |
695 | UnsupportedSignatureSubpacket Word8 B.ByteString | 696 | UnsupportedSignatureSubpacket Word8 B.ByteString |
696 | deriving (Show, Read, Eq) | 697 | deriving (Show, Read, Eq) |
@@ -738,6 +739,8 @@ put_signature_subpacket (RevocablePacket exportable) = | |||
738 | (encode $ enum_to_word8 exportable, 7) | 739 | (encode $ enum_to_word8 exportable, 7) |
739 | put_signature_subpacket (KeyExpirationTimePacket time) = | 740 | put_signature_subpacket (KeyExpirationTimePacket time) = |
740 | (encode time, 9) | 741 | (encode time, 9) |
742 | put_signature_subpacket (PreferredSymmetricAlgorithmsPacket algos) = | ||
743 | (B.concat $ map encode algos, 11) | ||
741 | put_signature_subpacket (IssuerPacket keyid) = | 744 | put_signature_subpacket (IssuerPacket keyid) = |
742 | (encode (fst $ head $ readHex keyid :: Word64), 16) | 745 | (encode (fst $ head $ readHex keyid :: Word64), 16) |
743 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = | 746 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = |
@@ -761,6 +764,9 @@ parse_signature_subpacket 7 = | |||
761 | fmap (RevocablePacket . enum_from_word8) get | 764 | fmap (RevocablePacket . enum_from_word8) get |
762 | -- KeyExpirationTimePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.6 | 765 | -- KeyExpirationTimePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.6 |
763 | parse_signature_subpacket 9 = fmap KeyExpirationTimePacket get | 766 | parse_signature_subpacket 9 = fmap KeyExpirationTimePacket get |
767 | -- KeyExpirationTimePacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.6 | ||
768 | parse_signature_subpacket 11 = | ||
769 | fmap PreferredSymmetricAlgorithmsPacket listUntilEnd | ||
764 | -- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 | 770 | -- IssuerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.5 |
765 | parse_signature_subpacket 16 = do | 771 | parse_signature_subpacket 16 = do |
766 | keyid <- get :: Get Word64 | 772 | keyid <- get :: Get Word64 |