From 83712a1cc6c89c63d21d0f7623e5cc47dc2679e0 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Sun, 7 Aug 2011 16:42:13 -0500 Subject: Store trailer for signature verification --- lib/OpenPGP.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/OpenPGP.hs b/lib/OpenPGP.hs index e5b70cd..51e1c1f 100644 --- a/lib/OpenPGP.hs +++ b/lib/OpenPGP.hs @@ -25,7 +25,8 @@ data Packet = hashed_subpackets::[SignatureSubpacket], unhashed_subpackets::[SignatureSubpacket], hash_head::Word16, - signature::MPI + signature::MPI, + trailer::LZ.ByteString } | OnePassSignaturePacket { version::Word8, @@ -152,7 +153,8 @@ parse_packet 2 = do hashed_subpackets = hashed, unhashed_subpackets = unhashed, hash_head = hash_head, - signature = signature + signature = signature, + trailer = LZ.concat [encode version, encode signature_type, encode key_algorithm, encode hash_algorithm, encode (fromIntegral hashed_size :: Word16), hashed_data, LZ.pack [4, 0xff], encode ((6 + (fromIntegral hashed_size)) :: Word32)] }) -- OnePassSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.4 parse_packet 4 = do -- cgit v1.2.3