From 92f0a9c8b6c676281dcbee6e4bce938b969ef7c2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 14 Sep 2016 15:51:59 -0400 Subject: Added --chaff mode which uploads random junk to servers. This is useful both to test the server throttling of uploads, and to make it harder for servers to know if an object actually contains secret key information. This commit was sponsored by Brock Spratlen on Patreon. --- CmdLine.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs index 67af2da..51bfa5c 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -8,6 +8,7 @@ module CmdLine where import Types import Types.Storage import Tunables +import Servers (HostName) import qualified Gpg import Options.Applicative import qualified Data.ByteString.UTF8 as BU8 @@ -27,7 +28,7 @@ data CmdLine = CmdLine , serverConfig :: ServerConfig } -data Mode = Backup | Restore | UploadQueued | Server | Benchmark | Test +data Mode = Backup | Restore | UploadQueued | Server | Chaff HostName | Benchmark | Test deriving (Show) data ServerConfig = ServerConfig @@ -38,7 +39,7 @@ data ServerConfig = ServerConfig parse :: Parser CmdLine parse = CmdLine - <$> optional (backup <|> restore <|> uploadqueued <|> server <|> benchmark <|> test) + <$> optional (backup <|> restore <|> uploadqueued <|> server <|> chaff <|> benchmark <|> test) <*> optional (gpgswitch <|> fileswitch) <*> localstorageswitch <*> localstoragedirectoryopt @@ -65,6 +66,11 @@ parse = CmdLine ( long "server" <> help "Run as a keysafe server, accepting objects and storing them to ~/.keysafe/objects/local/" ) + chaff = Chaff <$> strOption + ( long "chaff" + <> metavar "HOSTNAME" + <> help "Upload random data to a keysafe server." + ) benchmark = flag' Benchmark ( long "benchmark" <> help "Benchmark speed of keysafe's cryptographic primitives." -- cgit v1.2.3