diff options
-rw-r--r-- | Data/OpenPGP.hs | 79 | ||||
-rw-r--r-- | Data/OpenPGP/Crypto.hs | 43 | ||||
-rw-r--r-- | tests/suite.hs | 68 |
3 files changed, 121 insertions, 69 deletions
diff --git a/Data/OpenPGP.hs b/Data/OpenPGP.hs index be50d1a..d950570 100644 --- a/Data/OpenPGP.hs +++ b/Data/OpenPGP.hs | |||
@@ -3,7 +3,47 @@ | |||
3 | -- The recommended way to import this module is: | 3 | -- The recommended way to import this module is: |
4 | -- | 4 | -- |
5 | -- > import qualified Data.OpenPGP as OpenPGP | 5 | -- > import qualified Data.OpenPGP as OpenPGP |
6 | module Data.OpenPGP (Message(..), Packet(..), SignatureSubpacket(..), HashAlgorithm(..), KeyAlgorithm(..), CompressionAlgorithm(..), MPI(..), fingerprint_material, signatures_and_data, signature_issuer, calculate_signature_trailer, decode_s2k_count, encode_s2k_count) where | 6 | module Data.OpenPGP ( |
7 | Packet(OnePassSignaturePacket, PublicKeyPacket, SecretKeyPacket, CompressedDataPacket, LiteralDataPacket, UserIDPacket, UnsupportedPacket), | ||
8 | compression_algorithm, | ||
9 | content, | ||
10 | encrypted_data, | ||
11 | filename, | ||
12 | format, | ||
13 | hash_algorithm, | ||
14 | hashed_subpackets, | ||
15 | hash_head, | ||
16 | key, | ||
17 | key_algorithm, | ||
18 | key_id, | ||
19 | message, | ||
20 | nested, | ||
21 | private_hash, | ||
22 | s2k_count, | ||
23 | s2k_hash_algorithm, | ||
24 | s2k_salt, | ||
25 | s2k_type, | ||
26 | s2k_useage, | ||
27 | signature, | ||
28 | signature_type, | ||
29 | symmetric_type, | ||
30 | timestamp, | ||
31 | trailer, | ||
32 | unhashed_subpackets, | ||
33 | version, | ||
34 | isSignaturePacket, | ||
35 | signaturePacket, | ||
36 | Message(..), | ||
37 | SignatureSubpacket(..), | ||
38 | HashAlgorithm(..), | ||
39 | KeyAlgorithm(..), | ||
40 | CompressionAlgorithm(..), | ||
41 | MPI(..), | ||
42 | fingerprint_material, | ||
43 | signatures_and_data, | ||
44 | signature_issuer, | ||
45 | decode_s2k_count, encode_s2k_count | ||
46 | ) where | ||
7 | 47 | ||
8 | import Control.Monad | 48 | import Control.Monad |
9 | import Data.Bits | 49 | import Data.Bits |
@@ -181,22 +221,16 @@ calculate_signature_trailer p = | |||
181 | 221 | ||
182 | put_packet :: (Num a) => Packet -> (LZ.ByteString, a) | 222 | put_packet :: (Num a) => Packet -> (LZ.ByteString, a) |
183 | put_packet (SignaturePacket { version = 4, | 223 | put_packet (SignaturePacket { version = 4, |
184 | signature_type = signature_type, | ||
185 | key_algorithm = key_algorithm, | ||
186 | hash_algorithm = hash_algorithm, | ||
187 | hashed_subpackets = hashed_subpackets, | ||
188 | unhashed_subpackets = unhashed_subpackets, | 224 | unhashed_subpackets = unhashed_subpackets, |
189 | hash_head = hash_head, | 225 | hash_head = hash_head, |
190 | signature = signature }) = | 226 | signature = signature, |
191 | (LZ.concat [ LZ.singleton 4, encode signature_type, | 227 | trailer = trailer }) = |
192 | encode key_algorithm, encode hash_algorithm, | 228 | (LZ.concat [ trailer_top, |
193 | encode (fromIntegral $ LZ.length hashed :: Word16), | ||
194 | hashed, | ||
195 | encode (fromIntegral $ LZ.length unhashed :: Word16), | 229 | encode (fromIntegral $ LZ.length unhashed :: Word16), |
196 | unhashed, | 230 | unhashed, |
197 | encode hash_head, encode signature ], 2) | 231 | encode hash_head, encode signature ], 2) |
198 | where | 232 | where |
199 | hashed = LZ.concat $ map encode hashed_subpackets | 233 | trailer_top = LZ.reverse $ LZ.drop 6 $ LZ.reverse trailer |
200 | unhashed = LZ.concat $ map encode unhashed_subpackets | 234 | unhashed = LZ.concat $ map encode unhashed_subpackets |
201 | put_packet (OnePassSignaturePacket { version = version, | 235 | put_packet (OnePassSignaturePacket { version = version, |
202 | signature_type = signature_type, | 236 | signature_type = signature_type, |
@@ -522,10 +556,8 @@ signatures_and_data :: Message -> ([Packet], [Packet]) | |||
522 | signatures_and_data (Message ((CompressedDataPacket {message = m}):_)) = | 556 | signatures_and_data (Message ((CompressedDataPacket {message = m}):_)) = |
523 | signatures_and_data m | 557 | signatures_and_data m |
524 | signatures_and_data (Message lst) = | 558 | signatures_and_data (Message lst) = |
525 | (filter isSig lst, filter isDta lst) | 559 | (filter isSignaturePacket lst, filter isDta lst) |
526 | where | 560 | where |
527 | isSig (SignaturePacket {}) = True | ||
528 | isSig _ = False | ||
529 | isDta (LiteralDataPacket {}) = True | 561 | isDta (LiteralDataPacket {}) = True |
530 | isDta _ = False | 562 | isDta _ = False |
531 | 563 | ||
@@ -631,3 +663,22 @@ encode_s2k_count iterations | |||
631 | encode_s2k_count' count c | 663 | encode_s2k_count' count c |
632 | | count < 32 = (count, c) | 664 | | count < 32 = (count, c) |
633 | | otherwise = encode_s2k_count' (count `shiftR` 1) (c+1) | 665 | | otherwise = encode_s2k_count' (count `shiftR` 1) (c+1) |
666 | |||
667 | -- SignaturePacket smart constructor | ||
668 | signaturePacket :: Word8 -> Word8 -> KeyAlgorithm -> HashAlgorithm -> [SignatureSubpacket] -> [SignatureSubpacket] -> Word16 -> MPI -> Packet | ||
669 | signaturePacket version signature_type key_algorithm hash_algorithm hashed_subpackets unhashed_subpackets hash_head signature = | ||
670 | let p = SignaturePacket { | ||
671 | version = version, | ||
672 | signature_type = signature_type, | ||
673 | key_algorithm = key_algorithm, | ||
674 | hash_algorithm = hash_algorithm, | ||
675 | hashed_subpackets = hashed_subpackets, | ||
676 | unhashed_subpackets = unhashed_subpackets, | ||
677 | hash_head = hash_head, | ||
678 | signature = signature, | ||
679 | trailer = undefined | ||
680 | } in p { trailer = calculate_signature_trailer p } | ||
681 | |||
682 | isSignaturePacket :: Packet -> Bool | ||
683 | isSignaturePacket (SignaturePacket {}) = True | ||
684 | isSignaturePacket _ = False | ||
diff --git a/Data/OpenPGP/Crypto.hs b/Data/OpenPGP/Crypto.hs index b34c395..173fe08 100644 --- a/Data/OpenPGP/Crypto.hs +++ b/Data/OpenPGP/Crypto.hs | |||
@@ -106,6 +106,8 @@ sign :: OpenPGP.Message -- ^ SecretKeys, one of which will be used | |||
106 | -> Integer -- ^ Timestamp for signature (unless sig supplied) | 106 | -> Integer -- ^ Timestamp for signature (unless sig supplied) |
107 | -> OpenPGP.Packet | 107 | -> OpenPGP.Packet |
108 | sign keys message hsh keyid timestamp = | 108 | sign keys message hsh keyid timestamp = |
109 | -- WARNING: this style of update is unsafe on most fields | ||
110 | -- it is safe on signature and hash_head, though | ||
109 | sig { | 111 | sig { |
110 | OpenPGP.signature = OpenPGP.MPI $ toNum final, | 112 | OpenPGP.signature = OpenPGP.MPI $ toNum final, |
111 | OpenPGP.hash_head = toNum $ take 2 final | 113 | OpenPGP.hash_head = toNum $ take 2 final |
@@ -124,32 +126,34 @@ sign keys message hsh keyid timestamp = | |||
124 | LZ.fromString firstUserID | 126 | LZ.fromString firstUserID |
125 | ] | 127 | ] |
126 | } `LZ.append` OpenPGP.trailer sig | 128 | } `LZ.append` OpenPGP.trailer sig |
127 | -- Always force key and hash algorithm | 129 | sig = (findSigOrDefault (find OpenPGP.isSignaturePacket m)) |
128 | sig = let s = (findSigOrDefault (find isSignature m)) { | ||
129 | OpenPGP.key_algorithm = OpenPGP.RSA, | ||
130 | OpenPGP.hash_algorithm = hsh | ||
131 | } in s { OpenPGP.trailer = OpenPGP.calculate_signature_trailer s } | ||
132 | 130 | ||
133 | -- Either a SignaturePacket was found, or we need to make one | 131 | -- Either a SignaturePacket was found, or we need to make one |
134 | findSigOrDefault (Just s) = s | 132 | findSigOrDefault (Just s) = OpenPGP.signaturePacket |
135 | findSigOrDefault Nothing = OpenPGP.SignaturePacket { | 133 | (OpenPGP.version s) |
136 | OpenPGP.version = 4, | 134 | (OpenPGP.signature_type s) |
137 | OpenPGP.key_algorithm = undefined, | 135 | OpenPGP.RSA -- force key and hash algorithm |
138 | OpenPGP.hash_algorithm = undefined, | 136 | hsh |
139 | OpenPGP.signature_type = defaultStype, | 137 | (OpenPGP.hashed_subpackets s) |
140 | OpenPGP.hashed_subpackets = [ | 138 | (OpenPGP.unhashed_subpackets s) |
139 | (OpenPGP.hash_head s) | ||
140 | (OpenPGP.signature s) | ||
141 | findSigOrDefault Nothing = OpenPGP.signaturePacket | ||
142 | 4 | ||
143 | defaultStype | ||
144 | OpenPGP.RSA | ||
145 | hsh | ||
146 | ([ | ||
141 | -- Do we really need to pass in timestamp just for the default? | 147 | -- Do we really need to pass in timestamp just for the default? |
142 | OpenPGP.SignatureCreationTimePacket $ fromIntegral timestamp, | 148 | OpenPGP.SignatureCreationTimePacket $ fromIntegral timestamp, |
143 | OpenPGP.IssuerPacket keyid' | 149 | OpenPGP.IssuerPacket keyid' |
144 | ] ++ (case signOver of | 150 | ] ++ (case signOver of |
145 | OpenPGP.LiteralDataPacket {} -> [] | 151 | OpenPGP.LiteralDataPacket {} -> [] |
146 | _ -> [] -- TODO: OpenPGP.KeyFlagsPacket [0x01, 0x02] | 152 | _ -> [] -- TODO: OpenPGP.KeyFlagsPacket [0x01, 0x02] |
147 | ), | 153 | )) |
148 | OpenPGP.unhashed_subpackets = [], | 154 | [] |
149 | OpenPGP.signature = undefined, | 155 | undefined |
150 | OpenPGP.trailer = undefined, | 156 | undefined |
151 | OpenPGP.hash_head = undefined | ||
152 | } | ||
153 | 157 | ||
154 | keyid' = reverse $ take 16 $ reverse $ fingerprint k | 158 | keyid' = reverse $ take 16 $ reverse $ fingerprint k |
155 | Just k = find_key keys keyid | 159 | Just k = find_key keys keyid |
@@ -169,8 +173,5 @@ sign keys message hsh keyid timestamp = | |||
169 | isSignable (OpenPGP.SecretKeyPacket {}) = True | 173 | isSignable (OpenPGP.SecretKeyPacket {}) = True |
170 | isSignable _ = False | 174 | isSignable _ = False |
171 | 175 | ||
172 | isSignature (OpenPGP.SignaturePacket {}) = True | ||
173 | isSignature _ = False | ||
174 | |||
175 | isUserID (OpenPGP.UserIDPacket {}) = True | 176 | isUserID (OpenPGP.UserIDPacket {}) = True |
176 | isUserID _ = False | 177 | isUserID _ = False |
diff --git a/tests/suite.hs b/tests/suite.hs index 9480c0b..17ab3cb 100644 --- a/tests/suite.hs +++ b/tests/suite.hs | |||
@@ -63,90 +63,90 @@ tests secring = | |||
63 | testGroup "Serialization" [ | 63 | testGroup "Serialization" [ |
64 | testCase "000001-006.public_key" (testSerialization "000001-006.public_key"), | 64 | testCase "000001-006.public_key" (testSerialization "000001-006.public_key"), |
65 | testCase "000002-013.user_id" (testSerialization "000002-013.user_id"), | 65 | testCase "000002-013.user_id" (testSerialization "000002-013.user_id"), |
66 | -- Issue #11 -- testCase "000003-002.sig" (testSerialization "000003-002.sig"), | 66 | testCase "000003-002.sig" (testSerialization "000003-002.sig"), |
67 | testCase "000004-012.ring_trust" (testSerialization "000004-012.ring_trust"), | 67 | testCase "000004-012.ring_trust" (testSerialization "000004-012.ring_trust"), |
68 | -- Issue #11 -- testCase "000005-002.sig" (testSerialization "000005-002.sig"), | 68 | testCase "000005-002.sig" (testSerialization "000005-002.sig"), |
69 | testCase "000006-012.ring_trust" (testSerialization "000006-012.ring_trust"), | 69 | testCase "000006-012.ring_trust" (testSerialization "000006-012.ring_trust"), |
70 | -- Issue #11 -- testCase "000007-002.sig" (testSerialization "000007-002.sig"), | 70 | testCase "000007-002.sig" (testSerialization "000007-002.sig"), |
71 | testCase "000008-012.ring_trust" (testSerialization "000008-012.ring_trust"), | 71 | testCase "000008-012.ring_trust" (testSerialization "000008-012.ring_trust"), |
72 | -- Issue #11 -- testCase "000009-002.sig" (testSerialization "000009-002.sig"), | 72 | testCase "000009-002.sig" (testSerialization "000009-002.sig"), |
73 | testCase "000010-012.ring_trust" (testSerialization "000010-012.ring_trust"), | 73 | testCase "000010-012.ring_trust" (testSerialization "000010-012.ring_trust"), |
74 | -- Issue #11 -- testCase "000011-002.sig" (testSerialization "000011-002.sig"), | 74 | testCase "000011-002.sig" (testSerialization "000011-002.sig"), |
75 | testCase "000012-012.ring_trust" (testSerialization "000012-012.ring_trust"), | 75 | testCase "000012-012.ring_trust" (testSerialization "000012-012.ring_trust"), |
76 | testCase "000013-014.public_subkey" (testSerialization "000013-014.public_subkey"), | 76 | testCase "000013-014.public_subkey" (testSerialization "000013-014.public_subkey"), |
77 | -- Issue #11 -- testCase "000014-002.sig" (testSerialization "000014-002.sig"), | 77 | testCase "000014-002.sig" (testSerialization "000014-002.sig"), |
78 | testCase "000015-012.ring_trust" (testSerialization "000015-012.ring_trust"), | 78 | testCase "000015-012.ring_trust" (testSerialization "000015-012.ring_trust"), |
79 | testCase "000016-006.public_key" (testSerialization "000016-006.public_key"), | 79 | testCase "000016-006.public_key" (testSerialization "000016-006.public_key"), |
80 | -- Issue #11 -- testCase "000017-002.sig" (testSerialization "000017-002.sig"), | 80 | testCase "000017-002.sig" (testSerialization "000017-002.sig"), |
81 | testCase "000018-012.ring_trust" (testSerialization "000018-012.ring_trust"), | 81 | testCase "000018-012.ring_trust" (testSerialization "000018-012.ring_trust"), |
82 | testCase "000019-013.user_id" (testSerialization "000019-013.user_id"), | 82 | testCase "000019-013.user_id" (testSerialization "000019-013.user_id"), |
83 | -- Issue #11 -- testCase "000020-002.sig" (testSerialization "000020-002.sig"), | 83 | testCase "000020-002.sig" (testSerialization "000020-002.sig"), |
84 | testCase "000021-012.ring_trust" (testSerialization "000021-012.ring_trust"), | 84 | testCase "000021-012.ring_trust" (testSerialization "000021-012.ring_trust"), |
85 | -- Issue #11 -- testCase "000022-002.sig" (testSerialization "000022-002.sig"), | 85 | testCase "000022-002.sig" (testSerialization "000022-002.sig"), |
86 | testCase "000023-012.ring_trust" (testSerialization "000023-012.ring_trust"), | 86 | testCase "000023-012.ring_trust" (testSerialization "000023-012.ring_trust"), |
87 | testCase "000024-014.public_subkey" (testSerialization "000024-014.public_subkey"), | 87 | testCase "000024-014.public_subkey" (testSerialization "000024-014.public_subkey"), |
88 | -- Issue #11 -- testCase "000025-002.sig" (testSerialization "000025-002.sig"), | 88 | testCase "000025-002.sig" (testSerialization "000025-002.sig"), |
89 | testCase "000026-012.ring_trust" (testSerialization "000026-012.ring_trust"), | 89 | testCase "000026-012.ring_trust" (testSerialization "000026-012.ring_trust"), |
90 | testCase "000027-006.public_key" (testSerialization "000027-006.public_key"), | 90 | testCase "000027-006.public_key" (testSerialization "000027-006.public_key"), |
91 | -- Issue #11 -- testCase "000028-002.sig" (testSerialization "000028-002.sig"), | 91 | testCase "000028-002.sig" (testSerialization "000028-002.sig"), |
92 | testCase "000029-012.ring_trust" (testSerialization "000029-012.ring_trust"), | 92 | testCase "000029-012.ring_trust" (testSerialization "000029-012.ring_trust"), |
93 | testCase "000030-013.user_id" (testSerialization "000030-013.user_id"), | 93 | testCase "000030-013.user_id" (testSerialization "000030-013.user_id"), |
94 | -- Issue #11 -- testCase "000031-002.sig" (testSerialization "000031-002.sig"), | 94 | testCase "000031-002.sig" (testSerialization "000031-002.sig"), |
95 | testCase "000032-012.ring_trust" (testSerialization "000032-012.ring_trust"), | 95 | testCase "000032-012.ring_trust" (testSerialization "000032-012.ring_trust"), |
96 | -- Issue #11 -- testCase "000033-002.sig" (testSerialization "000033-002.sig"), | 96 | testCase "000033-002.sig" (testSerialization "000033-002.sig"), |
97 | testCase "000034-012.ring_trust" (testSerialization "000034-012.ring_trust"), | 97 | testCase "000034-012.ring_trust" (testSerialization "000034-012.ring_trust"), |
98 | testCase "000035-006.public_key" (testSerialization "000035-006.public_key"), | 98 | testCase "000035-006.public_key" (testSerialization "000035-006.public_key"), |
99 | testCase "000036-013.user_id" (testSerialization "000036-013.user_id"), | 99 | testCase "000036-013.user_id" (testSerialization "000036-013.user_id"), |
100 | -- Issue #11 -- testCase "000037-002.sig" (testSerialization "000037-002.sig"), | 100 | testCase "000037-002.sig" (testSerialization "000037-002.sig"), |
101 | testCase "000038-012.ring_trust" (testSerialization "000038-012.ring_trust"), | 101 | testCase "000038-012.ring_trust" (testSerialization "000038-012.ring_trust"), |
102 | -- Issue #11 -- testCase "000039-002.sig" (testSerialization "000039-002.sig"), | 102 | testCase "000039-002.sig" (testSerialization "000039-002.sig"), |
103 | testCase "000040-012.ring_trust" (testSerialization "000040-012.ring_trust"), | 103 | testCase "000040-012.ring_trust" (testSerialization "000040-012.ring_trust"), |
104 | testCase "000041-017.attribute" (testSerialization "000041-017.attribute"), | 104 | testCase "000041-017.attribute" (testSerialization "000041-017.attribute"), |
105 | -- Issue #11 -- testCase "000042-002.sig" (testSerialization "000042-002.sig"), | 105 | testCase "000042-002.sig" (testSerialization "000042-002.sig"), |
106 | testCase "000043-012.ring_trust" (testSerialization "000043-012.ring_trust"), | 106 | testCase "000043-012.ring_trust" (testSerialization "000043-012.ring_trust"), |
107 | testCase "000044-014.public_subkey" (testSerialization "000044-014.public_subkey"), | 107 | testCase "000044-014.public_subkey" (testSerialization "000044-014.public_subkey"), |
108 | -- Issue #11 -- testCase "000045-002.sig" (testSerialization "000045-002.sig"), | 108 | testCase "000045-002.sig" (testSerialization "000045-002.sig"), |
109 | testCase "000046-012.ring_trust" (testSerialization "000046-012.ring_trust"), | 109 | testCase "000046-012.ring_trust" (testSerialization "000046-012.ring_trust"), |
110 | testCase "000047-005.secret_key" (testSerialization "000047-005.secret_key"), | 110 | testCase "000047-005.secret_key" (testSerialization "000047-005.secret_key"), |
111 | testCase "000048-013.user_id" (testSerialization "000048-013.user_id"), | 111 | testCase "000048-013.user_id" (testSerialization "000048-013.user_id"), |
112 | -- Issue #11 -- testCase "000049-002.sig" (testSerialization "000049-002.sig"), | 112 | testCase "000049-002.sig" (testSerialization "000049-002.sig"), |
113 | testCase "000050-012.ring_trust" (testSerialization "000050-012.ring_trust"), | 113 | testCase "000050-012.ring_trust" (testSerialization "000050-012.ring_trust"), |
114 | testCase "000051-007.secret_subkey" (testSerialization "000051-007.secret_subkey"), | 114 | testCase "000051-007.secret_subkey" (testSerialization "000051-007.secret_subkey"), |
115 | -- Issue #11 -- testCase "000052-002.sig" (testSerialization "000052-002.sig"), | 115 | testCase "000052-002.sig" (testSerialization "000052-002.sig"), |
116 | testCase "000053-012.ring_trust" (testSerialization "000053-012.ring_trust"), | 116 | testCase "000053-012.ring_trust" (testSerialization "000053-012.ring_trust"), |
117 | testCase "000054-005.secret_key" (testSerialization "000054-005.secret_key"), | 117 | testCase "000054-005.secret_key" (testSerialization "000054-005.secret_key"), |
118 | -- Issue #11 -- testCase "000055-002.sig" (testSerialization "000055-002.sig"), | 118 | testCase "000055-002.sig" (testSerialization "000055-002.sig"), |
119 | testCase "000056-012.ring_trust" (testSerialization "000056-012.ring_trust"), | 119 | testCase "000056-012.ring_trust" (testSerialization "000056-012.ring_trust"), |
120 | testCase "000057-013.user_id" (testSerialization "000057-013.user_id"), | 120 | testCase "000057-013.user_id" (testSerialization "000057-013.user_id"), |
121 | -- Issue #11 -- testCase "000058-002.sig" (testSerialization "000058-002.sig"), | 121 | testCase "000058-002.sig" (testSerialization "000058-002.sig"), |
122 | testCase "000059-012.ring_trust" (testSerialization "000059-012.ring_trust"), | 122 | testCase "000059-012.ring_trust" (testSerialization "000059-012.ring_trust"), |
123 | testCase "000060-007.secret_subkey" (testSerialization "000060-007.secret_subkey"), | 123 | testCase "000060-007.secret_subkey" (testSerialization "000060-007.secret_subkey"), |
124 | -- Issue #11 -- testCase "000061-002.sig" (testSerialization "000061-002.sig"), | 124 | testCase "000061-002.sig" (testSerialization "000061-002.sig"), |
125 | testCase "000062-012.ring_trust" (testSerialization "000062-012.ring_trust"), | 125 | testCase "000062-012.ring_trust" (testSerialization "000062-012.ring_trust"), |
126 | testCase "000063-005.secret_key" (testSerialization "000063-005.secret_key"), | 126 | testCase "000063-005.secret_key" (testSerialization "000063-005.secret_key"), |
127 | -- Issue #11 -- testCase "000064-002.sig" (testSerialization "000064-002.sig"), | 127 | testCase "000064-002.sig" (testSerialization "000064-002.sig"), |
128 | testCase "000065-012.ring_trust" (testSerialization "000065-012.ring_trust"), | 128 | testCase "000065-012.ring_trust" (testSerialization "000065-012.ring_trust"), |
129 | testCase "000066-013.user_id" (testSerialization "000066-013.user_id"), | 129 | testCase "000066-013.user_id" (testSerialization "000066-013.user_id"), |
130 | -- Issue #11 -- testCase "000067-002.sig" (testSerialization "000067-002.sig"), | 130 | testCase "000067-002.sig" (testSerialization "000067-002.sig"), |
131 | testCase "000068-012.ring_trust" (testSerialization "000068-012.ring_trust"), | 131 | testCase "000068-012.ring_trust" (testSerialization "000068-012.ring_trust"), |
132 | testCase "000069-005.secret_key" (testSerialization "000069-005.secret_key"), | 132 | testCase "000069-005.secret_key" (testSerialization "000069-005.secret_key"), |
133 | testCase "000070-013.user_id" (testSerialization "000070-013.user_id"), | 133 | testCase "000070-013.user_id" (testSerialization "000070-013.user_id"), |
134 | -- Issue #11 -- testCase "000071-002.sig" (testSerialization "000071-002.sig"), | 134 | testCase "000071-002.sig" (testSerialization "000071-002.sig"), |
135 | testCase "000072-012.ring_trust" (testSerialization "000072-012.ring_trust"), | 135 | testCase "000072-012.ring_trust" (testSerialization "000072-012.ring_trust"), |
136 | testCase "000073-017.attribute" (testSerialization "000073-017.attribute"), | 136 | testCase "000073-017.attribute" (testSerialization "000073-017.attribute"), |
137 | -- Issue #11 -- testCase "000074-002.sig" (testSerialization "000074-002.sig"), | 137 | testCase "000074-002.sig" (testSerialization "000074-002.sig"), |
138 | testCase "000075-012.ring_trust" (testSerialization "000075-012.ring_trust"), | 138 | testCase "000075-012.ring_trust" (testSerialization "000075-012.ring_trust"), |
139 | testCase "000076-007.secret_subkey" (testSerialization "000076-007.secret_subkey"), | 139 | testCase "000076-007.secret_subkey" (testSerialization "000076-007.secret_subkey"), |
140 | -- Issue #11 -- testCase "000077-002.sig" (testSerialization "000077-002.sig"), | 140 | testCase "000077-002.sig" (testSerialization "000077-002.sig"), |
141 | testCase "000078-012.ring_trust" (testSerialization "000078-012.ring_trust"), | 141 | testCase "000078-012.ring_trust" (testSerialization "000078-012.ring_trust"), |
142 | -- Issue #11 -- testCase "pubring.gpg" (testSerialization "pubring.gpg"), | ||
143 | -- Issue #11 -- testCase "secring.gpg" (testSerialization "secring.gpg"), | 142 | -- Issue #11 -- testCase "secring.gpg" (testSerialization "secring.gpg"), |
144 | -- Issue #11 -- testCase "compressedsig.gpg" (testSerialization "compressedsig.gpg"), | 143 | testCase "pubring.gpg" (testSerialization "pubring.gpg"), |
145 | -- Issue #11 -- testCase "compressedsig-zlib.gpg" (testSerialization "compressedsig-zlib.gpg"), | 144 | testCase "compressedsig.gpg" (testSerialization "compressedsig.gpg"), |
146 | -- Issue #11 -- testCase "compressedsig-bzip2.gpg" (testSerialization "compressedsig-bzip2.gpg"), | 145 | testCase "compressedsig-zlib.gpg" (testSerialization "compressedsig-zlib.gpg"), |
147 | testCase "onepass_sig" (testSerialization "onepass_sig") | 146 | testCase "compressedsig-bzip2.gpg" (testSerialization "compressedsig-bzip2.gpg"), |
148 | -- Issue #11 -- testCase "uncompressed-ops-dsa.gpg" (testSerialization "uncompressed-ops-dsa.gpg"), | 147 | testCase "onepass_sig" (testSerialization "onepass_sig"), |
149 | -- Issue #11 -- testCase "uncompressed-ops-rsa.gpg" (testSerialization "uncompressed-ops-rsa.gpg"), | 148 | testCase "uncompressed-ops-dsa.gpg" (testSerialization "uncompressed-ops-dsa.gpg"), |
149 | testCase "uncompressed-ops-rsa.gpg" (testSerialization "uncompressed-ops-rsa.gpg") | ||
150 | ], | 150 | ], |
151 | testGroup "Fingerprint" [ | 151 | testGroup "Fingerprint" [ |
152 | testCase "000001-006.public_key" (testFingerprint "000001-006.public_key" "421F28FEAAD222F856C8FFD5D4D54EA16F87040E"), | 152 | testCase "000001-006.public_key" (testFingerprint "000001-006.public_key" "421F28FEAAD222F856C8FFD5D4D54EA16F87040E"), |