diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2011-08-07 16:42:13 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2011-08-07 16:42:13 -0500 |
commit | 83712a1cc6c89c63d21d0f7623e5cc47dc2679e0 (patch) | |
tree | c0a4a7173ead6cc784da2f2041a23ab1acc1e713 /lib/OpenPGP.hs | |
parent | cb7fb2be20d7c1286799652e14587a96bd6235ab (diff) |
Store trailer for signature verification
Diffstat (limited to 'lib/OpenPGP.hs')
-rw-r--r-- | lib/OpenPGP.hs | 6 |
1 files changed, 4 insertions, 2 deletions
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 = | |||
25 | hashed_subpackets::[SignatureSubpacket], | 25 | hashed_subpackets::[SignatureSubpacket], |
26 | unhashed_subpackets::[SignatureSubpacket], | 26 | unhashed_subpackets::[SignatureSubpacket], |
27 | hash_head::Word16, | 27 | hash_head::Word16, |
28 | signature::MPI | 28 | signature::MPI, |
29 | trailer::LZ.ByteString | ||
29 | } | | 30 | } | |
30 | OnePassSignaturePacket { | 31 | OnePassSignaturePacket { |
31 | version::Word8, | 32 | version::Word8, |
@@ -152,7 +153,8 @@ parse_packet 2 = do | |||
152 | hashed_subpackets = hashed, | 153 | hashed_subpackets = hashed, |
153 | unhashed_subpackets = unhashed, | 154 | unhashed_subpackets = unhashed, |
154 | hash_head = hash_head, | 155 | hash_head = hash_head, |
155 | signature = signature | 156 | signature = signature, |
157 | 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)] | ||
156 | }) | 158 | }) |
157 | -- OnePassSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.4 | 159 | -- OnePassSignaturePacket, http://tools.ietf.org/html/rfc4880#section-5.4 |
158 | parse_packet 4 = do | 160 | parse_packet 4 = do |