summaryrefslogtreecommitdiff
path: root/Data
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2012-04-25 19:24:14 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2012-04-25 19:24:14 -0500
commit70c479af48b201228884bbe31b05ca6bcd832ebf (patch)
treef0aa719d639ae0d400368bdffc832b0b665e133b /Data
parent0a474e49af677d1b9dd9570e3f54b5f52f8ab901 (diff)
A signature may be multiple MPIs
Diffstat (limited to 'Data')
-rw-r--r--Data/OpenPGP.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs
index 06aa930..8c248d8 100644
--- a/Data/OpenPGP.hs
+++ b/Data/OpenPGP.hs
@@ -79,7 +79,7 @@ data Packet =
79 hashed_subpackets::[SignatureSubpacket], 79 hashed_subpackets::[SignatureSubpacket],
80 unhashed_subpackets::[SignatureSubpacket], 80 unhashed_subpackets::[SignatureSubpacket],
81 hash_head::Word16, 81 hash_head::Word16,
82 signature::MPI, 82 signature::[MPI],
83 trailer::LZ.ByteString 83 trailer::LZ.ByteString
84 } | 84 } |
85 OnePassSignaturePacket { 85 OnePassSignaturePacket {
@@ -236,10 +236,11 @@ put_packet (SignaturePacket { version = 4,
236 hash_head = hash_head, 236 hash_head = hash_head,
237 signature = signature, 237 signature = signature,
238 trailer = trailer }) = 238 trailer = trailer }) =
239 (LZ.concat [ trailer_top, 239 (LZ.concat $ [
240 encode (fromIntegral $ LZ.length unhashed :: Word16), 240 trailer_top,
241 unhashed, 241 encode (fromIntegral $ LZ.length unhashed :: Word16),
242 encode hash_head, encode signature ], 2) 242 unhashed, encode hash_head
243 ] ++ map encode signature, 2)
243 where 244 where
244 trailer_top = LZ.reverse $ LZ.drop 6 $ LZ.reverse trailer 245 trailer_top = LZ.reverse $ LZ.drop 6 $ LZ.reverse trailer
245 unhashed = LZ.concat $ map encode unhashed_subpackets 246 unhashed = LZ.concat $ map encode unhashed_subpackets
@@ -686,7 +687,7 @@ find_key' fpr x xs keyid
686 thisid = reverse $ take (length keyid) (reverse (fpr x)) 687 thisid = reverse $ take (length keyid) (reverse (fpr x))
687 688
688-- | SignaturePacket smart constructor 689-- | SignaturePacket smart constructor
689signaturePacket :: Word8 -> Word8 -> KeyAlgorithm -> HashAlgorithm -> [SignatureSubpacket] -> [SignatureSubpacket] -> Word16 -> MPI -> Packet 690signaturePacket :: Word8 -> Word8 -> KeyAlgorithm -> HashAlgorithm -> [SignatureSubpacket] -> [SignatureSubpacket] -> Word16 -> [MPI] -> Packet
690signaturePacket version signature_type key_algorithm hash_algorithm hashed_subpackets unhashed_subpackets hash_head signature = 691signaturePacket version signature_type key_algorithm hash_algorithm hashed_subpackets unhashed_subpackets hash_head signature =
691 let p = SignaturePacket { 692 let p = SignaturePacket {
692 version = version, 693 version = version,