[tor-commits] [flashproxy/master] Add facilitator-pubkey option to flashproxy-client

dcf at torproject.org dcf at torproject.org
Tue Apr 30 18:34:28 UTC 2013


commit e80b7e1ab7a435463dfc4d1fdb25e92d10cfd5b4
Author: Arlo Breault <arlolra at gmail.com>
Date:   Tue Apr 30 10:48:53 2013 -0700

    Add facilitator-pubkey option to flashproxy-client
    
    Which will pass the option to the appropriate registration helpers.
    Also documents the new options in the manpages.
---
 doc/flashproxy-client.1.txt    |    3 +++
 doc/flashproxy-reg-email.1.txt |    3 +++
 doc/flashproxy-reg-url.1.txt   |    3 +++
 flashproxy-client              |   10 +++++++++-
 4 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/doc/flashproxy-client.1.txt b/doc/flashproxy-client.1.txt
index ce88092..0a7bf36 100644
--- a/doc/flashproxy-client.1.txt
+++ b/doc/flashproxy-client.1.txt
@@ -57,6 +57,9 @@ OPTIONS
 **-f**, **--facilitator**=__URL__::
     Advertise willingness to receive connections to URL.
 
+**--facilitator-pubkey**=__FILENAME__::
+    Encrypt registrations to the given PEM-formatted public key (default built-in).
+
 **-h**, **--help**::
     Display a help message and exit.
 
diff --git a/doc/flashproxy-reg-email.1.txt b/doc/flashproxy-reg-email.1.txt
index 9375aec..6175e92 100644
--- a/doc/flashproxy-reg-email.1.txt
+++ b/doc/flashproxy-reg-email.1.txt
@@ -44,6 +44,9 @@ OPTIONS
 **-e**, **--email**=__ADDRESS__::
     Send mail to __ADDRESS__ (default is "flashproxyreg.a at gmail.com").
 
+**--facilitator-pubkey**=__FILENAME__::
+    Encrypt registrations to the given PEM-formatted public key (default built-in).
+
 **-h**, **--help**::
     Display help message and exit.
 
diff --git a/doc/flashproxy-reg-url.1.txt b/doc/flashproxy-reg-url.1.txt
index 88b12be..8102246 100644
--- a/doc/flashproxy-reg-url.1.txt
+++ b/doc/flashproxy-reg-url.1.txt
@@ -25,6 +25,9 @@ OPTIONS
 **-f**, **--facilitator**=__URL__::
     Register with the given facilitator (by default "https://fp-facilitator.org/").
 
+**--facilitator-pubkey**=__FILENAME__::
+    Encrypt registrations to the given PEM-formatted public key (default built-in).
+
 **-h**, **--help**::
     Display help message and exit.
 
diff --git a/flashproxy-client b/flashproxy-client
index 22ce072..f2f2e26 100755
--- a/flashproxy-client
+++ b/flashproxy-client
@@ -49,6 +49,7 @@ class options(object):
     remote_addrs = []
     register_addr = None
     facilitator_url = None
+    facilitator_pubkey_filename = None
 
     managed = True
 
@@ -97,6 +98,9 @@ omitted, it uses a public default.
       --external            be an external proxy (don't interact with Tor using
                               environment variables and stdout).
   -f, --facilitator=URL     advertise willingness to receive connections to URL.
+      --facilitator-pubkey=FILENAME
+                            encrypt registrations to the given PEM-formatted
+                              public key (default built-in).
   -h, --help                show this help.
   -l, --log FILENAME        write log to FILENAME (default stdout).
       --pidfile FILENAME    write PID to FILENAME after daemonizing.
@@ -961,6 +965,8 @@ def build_register_command(method):
         af = ["-6"]
     if method == "email":
         command = [os.path.join(script_dir, "flashproxy-reg-email")] + af
+        if options.facilitator_pubkey_filename is not None:
+            command += ["--facilitator-pubkey", options.facilitator_pubkey_filename]
         return command
     elif method == "http":
         command = [os.path.join(script_dir, "flashproxy-reg-http")] + af
@@ -1042,7 +1048,7 @@ def main():
     register_addr_spec = None
     register_methods = []
 
-    opts, args = getopt.gnu_getopt(sys.argv[1:], "46f:hl:r", ["daemon", "external", "facilitator=", "help", "log=", "pidfile=", "register", "register-addr=", "register-methods=", "unsafe-logging"])
+    opts, args = getopt.gnu_getopt(sys.argv[1:], "46f:hl:r", ["daemon", "external", "facilitator=", "facilitator-pubkey=", "help", "log=", "pidfile=", "register", "register-addr=", "register-methods=", "unsafe-logging"])
     for o, a in opts:
         if o == "-4":
             options.address_family = socket.AF_INET
@@ -1054,6 +1060,8 @@ def main():
             options.managed = False
         elif o == "-f" or o == "--facilitator":
             options.facilitator_url = a
+        elif o == "--facilitator-pubkey":
+            options.facilitator_pubkey_filename = a
         elif o == "-h" or o == "--help":
             usage()
             sys.exit()





More information about the tor-commits mailing list