diff options
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 598fe75..a151e7b 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -696,7 +696,7 @@ parse_packet 2 = do | |||
696 | signature = signature, | 696 | signature = signature, |
697 | trailer = B.concat [encode signature_type, encode creation_time] | 697 | trailer = B.concat [encode signature_type, encode creation_time] |
698 | } | 698 | } |
699 | 4 -> do | 699 | x | x==4 || x==5 -> do |
700 | signature_type <- get | 700 | signature_type <- get |
701 | key_algorithm <- get | 701 | key_algorithm <- get |
702 | hash_algorithm <- get | 702 | hash_algorithm <- get |
@@ -724,8 +724,10 @@ parse_packet 2 = do | |||
724 | , encode hash_algorithm | 724 | , encode hash_algorithm |
725 | , encode (fromIntegral hashed_size :: Word16) | 725 | , encode (fromIntegral hashed_size :: Word16) |
726 | , hashed_data | 726 | , hashed_data |
727 | , B.pack [4 , 0xff] | 727 | , B.pack [version , 0xff] |
728 | , encode ((6 + fromIntegral hashed_size) :: Word32)] | 728 | , if version==4 |
729 | then encode ((6 + fromIntegral hashed_size) :: Word32) | ||
730 | else encode ((6 + fromIntegral hashed_size) :: Word64)] | ||
729 | } | 731 | } |
730 | x -> fail $ "Unknown SignaturePacket version " ++ show x ++ "." | 732 | x -> fail $ "Unknown SignaturePacket version " ++ show x ++ "." |
731 | -- SymmetricSessionKeyPacket, http://tools.ietf.org/html/rfc4880#section-5.3 | 733 | -- SymmetricSessionKeyPacket, http://tools.ietf.org/html/rfc4880#section-5.3 |