summaryrefslogtreecommitdiff
path: root/Arbitrary.patch
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2013-01-01 13:08:12 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2013-01-01 13:08:12 -0500
commit9e4f996c68c3901bab4a5e1e70638c2531a85994 (patch)
tree38b7e03b2208d56e3e19652335fda7d4f327b901 /Arbitrary.patch
parent06f96ec8d862e43d12cfb4c3ad8650395cfc662c (diff)
Proper S2K type
S2K is a seperate concept and is used in both secret key packets and SymmetricallyEncryptedSessionKey packets. It should have its own parser and thus its own type. This also cleans up the SecretKeyPacket record considerably (the many Maybe fields were a smell). SecretKeyPacket.s2k should be set to (Just $ SimpleS2K MD5) in fallback cases. symmetric_algorithm should be set to Unencrypted when s2k_useage is 0. s2k_useage itself is only needed for the different between 255 and 254 (different checksum). Round trip encode/decode tests for S2K work.
Diffstat (limited to 'Arbitrary.patch')
-rw-r--r--Arbitrary.patch8
1 files changed, 8 insertions, 0 deletions
diff --git a/Arbitrary.patch b/Arbitrary.patch
index 641609f..2d14399 100644
--- a/Arbitrary.patch
+++ b/Arbitrary.patch
@@ -24,6 +24,14 @@
24 2 -> do x1 <- arbitrary 24 2 -> do x1 <- arbitrary
25 x2 <- arbitrary 25 x2 <- arbitrary
26 x3 <- arbitrary 26 x3 <- arbitrary
27@@ -88,5 +93,5 @@
28 x2 <- arbitrary
29- x3 <- arbitrary
30+ x3 <- fmap decode_s2k_count arbitrary
31 return (IteratedSaltedS2K x1 x2 x3)
32- 3 -> do x1 <- arbitrary
33+ 3 -> do x1 <- suchThat arbitrary (`notElem` [0,1,3])
34 x2 <- arbitrary
27@@ -73,7 +72,7 @@ 35@@ -73,7 +72,7 @@
28 4 -> return SHA384 36 4 -> return SHA384
29 5 -> return SHA512 37 5 -> return SHA512