]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'feature-17178-v7-squashed-v2'
authorNick Mathewson <nickm@torproject.org>
Tue, 13 Sep 2016 14:20:08 +0000 (10:20 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 13 Sep 2016 14:20:08 +0000 (10:20 -0400)
1  2 
doc/tor.1.txt
src/or/circuitbuild.c
src/or/config.c
src/or/connection_edge.c
src/or/or.h
src/or/rendclient.c
src/or/rendservice.c
src/test/test_options.c

diff --cc doc/tor.1.txt
Simple merge
Simple merge
diff --cc src/or/config.c
Simple merge
Simple merge
diff --cc src/or/or.h
Simple merge
Simple merge
index 8d3a7d704c1590f46721c180fa94b0f6689e5e0e,cce63f29fa64a81150cd8f30940fc55071ede616..4f7d7aa726a329f035dfac44b81978e70f612621
@@@ -3896,12 -4179,50 +4179,51 @@@ rend_service_set_connection_addr_port(e
      return -2;
  }
  
- /* Stub that should be replaced with the #17178 version of the function
-  * when merging. */
+ /* Are HiddenServiceSingleHopMode and HiddenServiceNonAnonymousMode consistent?
+  */
+ static int
+ rend_service_non_anonymous_mode_consistent(const or_options_t *options)
+ {
+   /* !! is used to make these options boolean */
+   return (!! options->HiddenServiceSingleHopMode ==
+           !! options->HiddenServiceNonAnonymousMode);
+ }
+ /* Do the options allow onion services to make direct (non-anonymous)
+  * connections to introduction or rendezvous points?
+  * Must only be called after options_validate_single_onion() has successfully
+  * checked onion service option consistency.
+  * Returns true if tor is in HiddenServiceSingleHopMode. */
  int
- rend_service_allow_direct_connection(const or_options_t *options)
+ rend_service_allow_non_anonymous_connection(const or_options_t *options)
  {
-   (void)options;
-   return 0;
+   tor_assert(rend_service_non_anonymous_mode_consistent(options));
+   return options->HiddenServiceSingleHopMode ? 1 : 0;
+ }
+ /* Do the options allow us to reveal the exact startup time of the onion
+  * service?
+  * Single Onion Services prioritise availability over hiding their
+  * startup time, as their IP address is publicly discoverable anyway.
+  * Must only be called after options_validate_single_onion() has successfully
+  * checked onion service option consistency.
+  * Returns true if tor is in non-anonymous hidden service mode. */
+ int
+ rend_service_reveal_startup_time(const or_options_t *options)
+ {
+   tor_assert(rend_service_non_anonymous_mode_consistent(options));
+   return rend_service_non_anonymous_mode_enabled(options);
+ }
+ /* Is non-anonymous mode enabled using the HiddenServiceNonAnonymousMode
+  * config option?
+  * Must only be called after options_validate_single_onion() has successfully
+  * checked onion service option consistency.
+  */
+ int
+ rend_service_non_anonymous_mode_enabled(const or_options_t *options)
+ {
+   tor_assert(rend_service_non_anonymous_mode_consistent(options));
+   return options->HiddenServiceNonAnonymousMode ? 1 : 0;
  }
 +
Simple merge