private const string GCONF_DIR_TOR = "/apps/maemo/tor";
private const string GCONF_KEY_TOR_ENABLED = GCONF_DIR_TOR + "/enabled";
private const string GCONF_KEY_BRIDGES = GCONF_DIR_TOR + "/bridges";
+ private const string GCONF_KEY_EXITNODES = GCONF_DIR_TOR + "/exit_nodes";
private const string GCONF_DIR_PROXY_HTTP = "/system/http_proxy";
private const string GCONF_KEY_PROXY_HTTP_ENABLED = GCONF_DIR_PROXY_HTTP + "/use_http_proxy";
"Failed to set up bridge relays");
}
}
+
+ var exits = gconf.get_list (GCONF_KEY_EXITNODES, GConf.ValueType.STRING);
+
+ if (exits.length () > 0) {
+ // Enable strict exit nodes
+ tor_control.set_conf_list ("ExitNodes", exits);
+ tor_control.set_conf_bool ("StrictExitNodes", true);
+
+ bool strict = yield tor_control.get_conf_bool_async ("StrictExitNodes");
+ if (!strict) {
+ Hildon.Banner.show_information (null, null,
+ "Failed to set up strict exit nodes");
+ }
+ }
}
/**
}
/**
+ * Show the exit node configuration dialog
+ */
+ private void exit_nodes_clicked_cb () {
+ var dialog = new ExitNodeDialog (tor_control);
+ dialog.show ();
+ }
+
+ /**
* Check whether the IP address consists of four numbers in the 0..255 range
*/
bool is_valid_ip_address (string address) {
private void button_clicked_cb () {
var dialog = new Gtk.Dialog ();
var content = (Gtk.VBox) dialog.get_content_area ();
- content.set_size_request (-1, 2*70);
+ content.set_size_request (-1, 3*70);
dialog.set_title (_("Tor: anonymity online"));
button.clicked.connect (bridges_clicked_cb);
content.pack_start (button, true, true, 0);
+ button = new Hildon.Button.with_text (Hildon.SizeType.FINGER_HEIGHT,
+ Hildon.ButtonArrangement.VERTICAL,
+ _("Restrict exit nodes"),
+ get_exit_node_list ());
+ button.set_style (Hildon.ButtonStyle.PICKER);
+ button.set_alignment (0, 0.5f, 0, 0.5f);
+ button.clicked.connect (exit_nodes_clicked_cb);
+ content.pack_start (button, true, true, 0);
+
dialog.add_button (_("Log"), RESPONSE_LOG);
dialog.add_button (_("Save"), Gtk.ResponseType.ACCEPT);
return list;
}
+ private string get_exit_node_list () {
+ string list = null;
+ var exits = new SList<string> ();
+ try {
+ exits = gconf.get_list (GCONF_KEY_EXITNODES, GConf.ValueType.STRING);
+ } catch (Error e) {
+ error ("Error loading exit nodes: %s", e.message);
+ }
+ foreach (string exit in exits) {
+ if (list == null)
+ list = exit;
+ else
+ list += ", " + exit;
+ }
+ if (list == null)
+ list = _("None");
+
+ return list;
+ }
+
/**
* Callback for the ConIc connection-event signal
*/