diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:33:50 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-04-27 17:33:50 -0500 |
commit | 1b13c5f127b31c1b52bc8fb87415f62c2e769346 (patch) | |
tree | 3ed7bfb30e9936873737fc791159307745ffd64d /Data | |
parent | 00752abf7f58d0339179c13d60f1bcbe9c4820bc (diff) |
PreferredKeyServerPacket
Diffstat (limited to 'Data')
-rw-r--r-- | Data/OpenPGP.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index 0895d83..39dd053 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -708,6 +708,7 @@ data SignatureSubpacket = | |||
708 | PreferredHashAlgorithmsPacket [HashAlgorithm] | | 708 | PreferredHashAlgorithmsPacket [HashAlgorithm] | |
709 | PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | | 709 | PreferredCompressionAlgorithmsPacket [CompressionAlgorithm] | |
710 | KeyServerPreferencesPacket {keyserver_no_modify::Bool} | | 710 | KeyServerPreferencesPacket {keyserver_no_modify::Bool} | |
711 | PreferredKeyServerPacket String | | ||
711 | UnsupportedSignatureSubpacket Word8 B.ByteString | 712 | UnsupportedSignatureSubpacket Word8 B.ByteString |
712 | deriving (Show, Read, Eq) | 713 | deriving (Show, Read, Eq) |
713 | 714 | ||
@@ -782,6 +783,8 @@ put_signature_subpacket (PreferredCompressionAlgorithmsPacket algos) = | |||
782 | (B.concat $ map encode algos, 22) | 783 | (B.concat $ map encode algos, 22) |
783 | put_signature_subpacket (KeyServerPreferencesPacket no_modify) = | 784 | put_signature_subpacket (KeyServerPreferencesPacket no_modify) = |
784 | (B.singleton (if no_modify then 0x80 else 0x0), 23) | 785 | (B.singleton (if no_modify then 0x80 else 0x0), 23) |
786 | put_signature_subpacket (PreferredKeyServerPacket uri) = | ||
787 | (B.fromString uri, 24) | ||
785 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = | 788 | put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = |
786 | (bytes, tag) | 789 | (bytes, tag) |
787 | 790 | ||
@@ -856,6 +859,9 @@ parse_signature_subpacket 23 = do | |||
856 | return $ KeyServerPreferencesPacket { | 859 | return $ KeyServerPreferencesPacket { |
857 | keyserver_no_modify = if flag1 == 0x80 then True else False | 860 | keyserver_no_modify = if flag1 == 0x80 then True else False |
858 | } | 861 | } |
862 | -- PreferredKeyServerPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.18 | ||
863 | parse_signature_subpacket 24 = | ||
864 | fmap (PreferredKeyServerPacket . B.toString) getRemainingByteString | ||
859 | -- Represent unsupported packets as their tag and literal bytes | 865 | -- Represent unsupported packets as their tag and literal bytes |
860 | parse_signature_subpacket tag = | 866 | parse_signature_subpacket tag = |
861 | fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString | 867 | fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString |