diff options
author | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-08-06 10:22:47 -0500 |
---|---|---|
committer | Stephen Paul Weber <singpolyma@singpolyma.net> | 2012-08-06 10:22:47 -0500 |
commit | dcf4e3a203c4a93389e35c23b6fa5c79469a1dcf (patch) | |
tree | 62dc80bfa2329b79ee7cde5693b3f0aec41ddab2 /Arbitrary.patch | |
parent | 5c851e7727ee261c498d6128805b9705f3f677f1 (diff) |
Put v2/3 signatures as well
Add trailer calculation for v2/3
Add code to put these packets back out
Change Arbitrary instance to allow for these kinds of signatures
Tests pass
Diffstat (limited to 'Arbitrary.patch')
-rw-r--r-- | Arbitrary.patch | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Arbitrary.patch b/Arbitrary.patch index f1f3824..fa78846 100644 --- a/Arbitrary.patch +++ b/Arbitrary.patch | |||
@@ -1,6 +1,6 @@ | |||
1 | --- Data/OpenPGP/Arbitrary.hs 2012-04-27 12:38:11.492411339 -0500 | 1 | --- Data/OpenPGP/Arbitrary.hs 2012-04-27 12:38:11.492411339 -0500 |
2 | +++ arb.s 2012-04-27 12:37:57.176469214 -0500 | 2 | +++ arb.s 2012-04-27 12:37:57.176469214 -0500 |
3 | @@ -14,13 +14,11 @@ | 3 | @@ -14,13 +14,18 @@ |
4 | 0 -> do x1 <- arbitrary | 4 | 0 -> do x1 <- arbitrary |
5 | x2 <- arbitrary | 5 | x2 <- arbitrary |
6 | x3 <- arbitrary | 6 | x3 <- arbitrary |
@@ -13,7 +13,14 @@ | |||
13 | - x8 <- arbitrary | 13 | - x8 <- arbitrary |
14 | - x9 <- arbitrary | 14 | - x9 <- arbitrary |
15 | - return (SignaturePacket x1 x2 x3 x4 x5 x6 x7 x8 x9) | 15 | - return (SignaturePacket x1 x2 x3 x4 x5 x6 x7 x8 x9) |
16 | + return (signaturePacket 4 x1 x2 x3 x4 x5 x6 x7) | 16 | + version <- choose (2 :: Word8, 4) |
17 | + case version of | ||
18 | + 4 -> | ||
19 | + return (signaturePacket 4 x1 x2 x3 x4 x5 x6 x7) | ||
20 | + _ -> do | ||
21 | + creation_time <- arbitrary | ||
22 | + keyid <- vectorOf 16 (elements (['0'..'9'] ++ ['A'..'F'])) | ||
23 | + return (signaturePacket version x1 x2 x3 [] [SignatureCreationTimePacket creation_time, IssuerPacket keyid] x6 x7) | ||
17 | 1 -> do x1 <- arbitrary | 24 | 1 -> do x1 <- arbitrary |
18 | x2 <- arbitrary | 25 | x2 <- arbitrary |
19 | x3 <- arbitrary | 26 | x3 <- arbitrary |