summaryrefslogtreecommitdiffhomepage
path: root/Storage.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-14 21:30:01 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-14 21:30:01 -0400
commit3a9039eee3465bdd2772abc304658b2c0f9b1a6d (patch)
tree5a56ee5ca64954a142a96fbf0f73961469b71401 /Storage.hs
parentb6e4a09f1b60e80fe065fd21621902113a1bc9ea (diff)
downloadkeysafe-3a9039eee3465bdd2772abc304658b2c0f9b1a6d.tar.gz
chaff only the current object size, not old ones
Diffstat (limited to 'Storage.hs')
-rw-r--r--Storage.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Storage.hs b/Storage.hs
index 40c0dd4..ded4bbf 100644
--- a/Storage.hs
+++ b/Storage.hs
@@ -145,13 +145,13 @@ storeChaff hn port = forever $ do
-- Prefix "random chaff" to the name to avoid ever using a name
-- that a real user might want to use.
let sis = shareIdents testModeTunables (Name $ "random chaff:" <> randomname) (KeyFile "random")
- mapConcurrently (go sis rng' (concat (repeat knownObjectSizes)))
+ mapConcurrently (go sis rng')
[1..totalObjects (shareParams testModeTunables)]
where
server = networkStorage Nothing $ Server hn port
- go _ _ [] _ = return ()
- go sis rng (s:sizes) n = do
- let (b, rng') = cprgGenerate s rng
+ objsize = objectSize defaultTunables * shareOverhead defaultTunables
+ go sis rng n = do
+ let (b, rng') = cprgGenerate objsize rng
let share = Share 0 (StorableObject b)
let (is, sis') = nextShareIdents sis
let i = S.toList is !! (n - 1)
@@ -160,4 +160,4 @@ storeChaff hn port = forever $ do
StoreSuccess -> putStr "+"
_ -> putStr "!"
hFlush stdout
- go sis' rng' sizes n
+ go sis' rng' n