summaryrefslogtreecommitdiff
path: root/Data
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 16:59:52 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2012-04-27 16:59:52 -0500
commit36f0fb4baf0b144a5bfcb52c0256f3b94d550b99 (patch)
tree54ad572498e17e35b84653312e453ae584408b5c /Data
parentc37a053b2d8f6dee92b01b66688a991f7dc936ba (diff)
PreferredHashAlgorithmsPacket
Diffstat (limited to 'Data')
-rw-r--r--Data/OpenPGP.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs
index dff3ae5..051bd5d 100644
--- a/Data/OpenPGP.hs
+++ b/Data/OpenPGP.hs
@@ -705,6 +705,7 @@ data SignatureSubpacket =
705 notation_name::String, 705 notation_name::String,
706 notation_value::String 706 notation_value::String
707 } | 707 } |
708 PreferredHashAlgorithmsPacket [HashAlgorithm] |
708 UnsupportedSignatureSubpacket Word8 B.ByteString 709 UnsupportedSignatureSubpacket Word8 B.ByteString
709 deriving (Show, Read, Eq) 710 deriving (Show, Read, Eq)
710 711
@@ -773,6 +774,8 @@ put_signature_subpacket (NotationDataPacket human_readable name value) =
773 valuebs = B.fromString value 774 valuebs = B.fromString value
774 namebs = B.fromString name 775 namebs = B.fromString name
775 flag1 = if human_readable then 0x80 else 0x0 776 flag1 = if human_readable then 0x80 else 0x0
777put_signature_subpacket (PreferredHashAlgorithmsPacket algos) =
778 (B.concat $ map encode algos, 21)
776put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) = 779put_signature_subpacket (UnsupportedSignatureSubpacket tag bytes) =
777 (bytes, tag) 780 (bytes, tag)
778 781
@@ -833,6 +836,9 @@ parse_signature_subpacket 20 = do
833 where 836 where
834 get4word8 :: Get (Word8,Word8,Word8,Word8) 837 get4word8 :: Get (Word8,Word8,Word8,Word8)
835 get4word8 = liftM4 (,,,) get get get get 838 get4word8 = liftM4 (,,,) get get get get
839-- PreferredHashAlgorithmsPacket, http://tools.ietf.org/html/rfc4880#section-5.2.3.8
840parse_signature_subpacket 21 =
841 fmap PreferredHashAlgorithmsPacket listUntilEnd
836-- Represent unsupported packets as their tag and literal bytes 842-- Represent unsupported packets as their tag and literal bytes
837parse_signature_subpacket tag = 843parse_signature_subpacket tag =
838 fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString 844 fmap (UnsupportedSignatureSubpacket tag) getRemainingByteString