summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2020-05-16 08:18:11 -0400
committerJoe Crayne <joe@jerkface.net>2020-05-19 11:59:17 -0400
commit1e97c0b23cf96110e0c9ba3f9776dbb4b278bfd7 (patch)
tree4c0b6641fca4069c17ee482dc59b380281a85c10
parentcee4108007b2a384f54b4a8943a612fdc3c9f260 (diff)
Parse v5 signatures (draft-ietf-openpgp-rfc4880bis-09).
-rw-r--r--Data/OpenPGP.hs8
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