added offloaded key generation

this adds a new service to pre-generate RSA key pairs.  This allows
the expensive (i.e. slow) key generation to be placed into a process
outside the node, so that the node's reactor will not block when it
needs a key pair, but instead can retrieve them from a pool of already
generated key pairs in the key-generator service.

it adds a tahoe create-key-generator command which initialises an 
empty dir with a tahoe-key-generator.tac file which can then be run
via twistd.  it stashes its .pem and portnum for furl stability and
writes the furl of the key gen service to key_generator.furl, also
printing it to stdout.

by placing a key_generator.furl file into the nodes config directory
(e.g. ~/.tahoe) a node will attempt to connect to such a service, and
will use that when creating mutable files (i.e. directories) whenever
possible.  if the keygen service is unavailable, it will perform the
key generation locally instead, as before.
This commit is contained in:
robk-tahoe
2008-04-01 18:45:13 -07:00
parent d6c66f99c0
commit 5578559b85
9 changed files with 211 additions and 15 deletions

View File

@ -4,9 +4,13 @@ from cStringIO import StringIO
from twisted.python import usage
from allmydata.scripts.common import BaseOptions
import debug, create_node, startstop_node, cli
import debug, create_node, startstop_node, cli, keygen
_general_commands = create_node.subCommands + debug.subCommands + cli.subCommands
_general_commands = ( create_node.subCommands
+ keygen.subCommands
+ debug.subCommands
+ cli.subCommands
)
class Options(BaseOptions, usage.Options):
synopsis = "Usage: tahoe <command> [command options]"
@ -60,6 +64,8 @@ def runner(argv, run_by_human=True, stdout=sys.stdout, stderr=sys.stderr,
rc = debug.dispatch[command](so, stdout, stderr)
elif command in cli.dispatch:
rc = cli.dispatch[command](so, stdout, stderr)
elif command in keygen.dispatch:
rc = keygen.dispatch[command](so, stdout, stderr)
elif command in ac_dispatch:
rc = ac_dispatch[command](so, stdout, stderr)
else: