diff options
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 90c254f..98622a1 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -13,6 +13,7 @@ module Data.OpenPGP ( | |||
13 | CompressedDataPacket, | 13 | CompressedDataPacket, |
14 | MarkerPacket, | 14 | MarkerPacket, |
15 | LiteralDataPacket, | 15 | LiteralDataPacket, |
16 | TrustPacket, | ||
16 | UserIDPacket, | 17 | UserIDPacket, |
17 | EncryptedDataPacket, | 18 | EncryptedDataPacket, |
18 | ModificationDetectionCodePacket, | 19 | ModificationDetectionCodePacket, |
@@ -217,6 +218,7 @@ data Packet = | |||
217 | timestamp::Word32, | 218 | timestamp::Word32, |
218 | content::B.ByteString | 219 | content::B.ByteString |
219 | } | | 220 | } | |
221 | TrustPacket B.ByteString | | ||
220 | UserIDPacket String | | 222 | UserIDPacket String | |
221 | EncryptedDataPacket { | 223 | EncryptedDataPacket { |
222 | version::Word8, -- 0 for old-skool no-MDC (tag 9) | 224 | version::Word8, -- 0 for old-skool no-MDC (tag 9) |
@@ -478,6 +480,7 @@ put_packet (LiteralDataPacket { format = format, filename = filename, | |||
478 | where | 480 | where |
479 | filename_l = (fromIntegral $ B.length lz_filename) :: Word8 | 481 | filename_l = (fromIntegral $ B.length lz_filename) :: Word8 |
480 | lz_filename = B.fromString filename | 482 | lz_filename = B.fromString filename |
483 | put_packet (TrustPacket bytes) = (bytes, 12) | ||
481 | put_packet (UserIDPacket txt) = (B.fromString txt, 13) | 484 | put_packet (UserIDPacket txt) = (B.fromString txt, 13) |
482 | put_packet (EncryptedDataPacket 0 encrypted_data) = (encrypted_data, 9) | 485 | put_packet (EncryptedDataPacket 0 encrypted_data) = (encrypted_data, 9) |
483 | put_packet (EncryptedDataPacket version encrypted_data) = | 486 | put_packet (EncryptedDataPacket version encrypted_data) = |
@@ -655,6 +658,8 @@ parse_packet 11 = do | |||
655 | timestamp = timestamp, | 658 | timestamp = timestamp, |
656 | content = content | 659 | content = content |
657 | } | 660 | } |
661 | -- TrustPacket, http://tools.ietf.org/html/rfc4880#section-5.10 | ||
662 | parse_packet 12 = fmap TrustPacket getRemainingByteString | ||
658 | -- UserIDPacket, http://tools.ietf.org/html/rfc4880#section-5.11 | 663 | -- UserIDPacket, http://tools.ietf.org/html/rfc4880#section-5.11 |
659 | parse_packet 13 = | 664 | parse_packet 13 = |
660 | fmap (UserIDPacket . B.toString) getRemainingByteString | 665 | fmap (UserIDPacket . B.toString) getRemainingByteString |