diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:29:49 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:29:49 -0500 |
commit | 00752abf7f58d0339179c13d60f1bcbe9c4820bc (patch) | |
tree | 34181e598f991ba13a2a48796a7728f9be32e51b /Data | |
parent | 91de0d55771dcecd776fdf03210748dd0225c583 (diff) |
KeyServerPreferencesPacket
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 4df32c5..0895d83 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -707,6 +707,7 @@ data SignatureSubpacket = | |||
707 | } | | 707 | } | |
708 | PreferredHashAlgorithmsPacket [HashAlgorithm] | | 708 | PreferredHashAlgorithmsPacket [HashAlgorithm] | |
709 | PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | | 709 | PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | |
710 | KeyServerPreferencesPacket {keyserver_no_modify::Bool} | | ||
710 | UnsupportedSignatureSubpacket Word8 B.ByteString | 711 | UnsupportedSignatureSubpacket Word8 B.ByteString |
711 | deriving (Show, Read, Eq) | 712 | deriving (Show, Read, Eq) |
712 | 713 | ||
@@ -779,6 +780,8 @@ put_signature_subpacket (PreferredHashAlgorithmsPacket algos) = | |||
779 | (B.concat $ map encode algos, 21) | 780 | (B.concat $ map encode algos, 21) |
780 | put_signature_subpacket (PreferredCompressionAlgorithmsPacket algos) = | 781 | put_signature_subpacket (PreferredCompressionAlgorithmsPacket algos) = |
781 | (B.concat $ map encode algos, 22) | 782 | (B.concat $ map encode algos, 22) |
783 | put_signature_subpacket (KeyServerPreferencesPacket no_modify) = | ||
784 | (B.singleton (if no_modify then 0x80 else 0x0), 23) | ||
782 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = | 785 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = |
783 | (bytes, tag) | 786 | (bytes, tag) |
784 | 787 | ||
@@ -846,6 +849,13 @@ parse_signature_subpacket 21 = | |||
846 | -- PreferredCompressionAlgorithmsPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.9 | 849 | -- PreferredCompressionAlgorithmsPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.9 |
847 | parse_signature_subpacket 22 = | 850 | parse_signature_subpacket 22 = |
848 | fmap PreferredCompressionAlgorithmsPacket listUntilEnd | 851 | fmap PreferredCompressionAlgorithmsPacket listUntilEnd |
852 | -- KeyServerPreferencesPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.17 | ||
853 | parse_signature_subpacket 23 = do | ||
854 | empty <- isEmpty | ||
855 | flag1 <- if empty then return 0 else get :: Get Word8 | ||
856 | return $ KeyServerPreferencesPacket { | ||
857 | keyserver_no_modify = if flag1 == 0x80 then True else False | ||
858 | } | ||
849 | -- Represent unsupported packets as their tag and literal bytes | 859 | -- Represent unsupported packets as their tag and literal bytes |
850 | parse_signature_subpacket tag = | 860 | parse_signature_subpacket tag = |
851 | fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString | 861 | fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString |