[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] Expose *CircuitPadding
commit e71c225ef146f663c1841bcea432d1884601d228
Author: Tad <tad@xxxxxxxxx>
Date: Tue Oct 8 20:44:23 2019 -0400
Expose *CircuitPadding
---
app-mini/src/main/res/values/strings.xml | 4 ++++
app-mini/src/main/res/xml/preferences.xml | 14 +++++++++++++-
app/src/main/res/values/strings.xml | 4 ++++
app/src/main/res/xml/preferences.xml | 14 +++++++++++++-
.../org/torproject/android/service/OrbotConstants.java | 2 ++
.../java/org/torproject/android/service/TorService.java | 12 ++++++++++++
6 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/app-mini/src/main/res/values/strings.xml b/app-mini/src/main/res/values/strings.xml
index 810ced96..78723c10 100644
--- a/app-mini/src/main/res/values/strings.xml
+++ b/app-mini/src/main/res/values/strings.xml
@@ -233,6 +233,10 @@
<string name="pref_connection_padding_summary">Always enables connection padding to defend against some forms of traffic analysis. Default: auto</string>
<string name="pref_reduced_connection_padding">Reduced connection padding</string>
<string name="pref_reduced_connection_padding_summary">Closes relay connections sooner and sends less padding packets to reduce data and battery usage</string>
+ <string name="pref_circuit_padding">Circuit padding</string>
+ <string name="pref_circuit_padding_summary">Enable circuit padding to defend against some forms of traffic analysis</string>
+ <string name="pref_reduced_circuit_padding">Reduced circuit padding</string>
+ <string name="pref_reduced_circuit_padding_summary">Use lower overhead padding algorithms to reduce data and battery usage</string>
<string name="pref_prefer_ipv6">Prefer IPv6 connections</string>
<string name="pref_prefer_ipv6_summary">Tells exits that IPv6 addresses are preferred</string>
<string name="pref_disable_ipv4">Disable IPv4 connections</string>
diff --git a/app-mini/src/main/res/xml/preferences.xml b/app-mini/src/main/res/xml/preferences.xml
index bda86acc..49be87a0 100644
--- a/app-mini/src/main/res/xml/preferences.xml
+++ b/app-mini/src/main/res/xml/preferences.xml
@@ -198,7 +198,7 @@
android:title="@string/pref_disable_ipv4" />
</PreferenceCategory>
- <PreferenceCategory android:title="ConnectionPadding">
+ <PreferenceCategory android:title="Padding">
<CheckBoxPreference
android:defaultValue="false"
android:enabled="true"
@@ -211,6 +211,18 @@
android:key="pref_reduced_connection_padding"
android:summary="@string/pref_reduced_connection_padding_summary"
android:title="@string/pref_reduced_connection_padding" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:enabled="true"
+ android:key="pref_circuit_padding"
+ android:summary="@string/pref_circuit_padding_summary"
+ android:title="@string/pref_circuit_padding" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:enabled="true"
+ android:key="pref_reduced_circuit_padding"
+ android:summary="@string/pref_reduced_circuit_padding_summary"
+ android:title="@string/pref_reduced_circuit_padding" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_proxy_title">
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4400c048..bff412a2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -233,6 +233,10 @@
<string name="pref_connection_padding_summary">Always enables connection padding to defend against some forms of traffic analysis. Default: auto</string>
<string name="pref_reduced_connection_padding">Reduced connection padding</string>
<string name="pref_reduced_connection_padding_summary">Closes relay connections sooner and sends less padding packets to reduce data and battery usage</string>
+ <string name="pref_circuit_padding">Circuit padding</string>
+ <string name="pref_circuit_padding_summary">Enable circuit padding to defend against some forms of traffic analysis</string>
+ <string name="pref_reduced_circuit_padding">Reduced circuit padding</string>
+ <string name="pref_reduced_circuit_padding_summary">Use lower overhead padding algorithms to reduce data and battery usage</string>
<string name="pref_prefer_ipv6">Prefer IPv6 connections</string>
<string name="pref_prefer_ipv6_summary">Tells exits that IPv6 addresses are preferred</string>
<string name="pref_disable_ipv4">Disable IPv4 connections</string>
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 49b90dfa..8477efbd 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -195,7 +195,7 @@
android:title="@string/pref_disable_ipv4" />
</PreferenceCategory>
- <PreferenceCategory android:title="ConnectionPadding">
+ <PreferenceCategory android:title="Padding">
<CheckBoxPreference
android:defaultValue="false"
android:enabled="true"
@@ -208,6 +208,18 @@
android:key="pref_reduced_connection_padding"
android:summary="@string/pref_reduced_connection_padding_summary"
android:title="@string/pref_reduced_connection_padding" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:enabled="true"
+ android:key="pref_circuit_padding"
+ android:summary="@string/pref_circuit_padding_summary"
+ android:title="@string/pref_circuit_padding" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:enabled="true"
+ android:key="pref_reduced_circuit_padding"
+ android:summary="@string/pref_reduced_circuit_padding_summary"
+ android:title="@string/pref_reduced_circuit_padding" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_proxy_title">
diff --git a/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java b/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java
index a5dec36e..8416f15e 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/OrbotConstants.java
@@ -25,6 +25,8 @@ public interface OrbotConstants {
String PREF_CONNECTION_PADDING = "pref_connection_padding";
String PREF_REDUCED_CONNECTION_PADDING = "pref_reduced_connection_padding";
+ String PREF_CIRCUIT_PADDING = "pref_circuit_padding";
+ String PREF_REDUCED_CIRCUIT_PADDING = "pref_reduced_circuit_padding";
String PREF_PREFER_IPV6 = "pref_prefer_ipv6";
String PREF_DISABLE_IPV4 = "pref_disable_ipv4";
diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorService.java b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
index e2eb9589..ce6e3086 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
@@ -700,6 +700,18 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
extraLines.append("ReducedConnectionPadding 1").append('\n');
}
+ if(prefs.getBoolean(OrbotConstants.PREF_CIRCUIT_PADDING, true))
+ {
+ extraLines.append("CircuitPadding 1").append('\n');
+ } else {
+ extraLines.append("CircuitPadding 0").append('\n');
+ }
+
+ if(prefs.getBoolean(OrbotConstants.PREF_REDUCED_CIRCUIT_PADDING, true))
+ {
+ extraLines.append("ReducedCircuitPadding 1").append('\n');
+ }
+
String transPort = prefs.getString("pref_transport", TorServiceConstants.TOR_TRANSPROXY_PORT_DEFAULT+"");
String dnsPort = prefs.getString("pref_dnsport", TorServiceConstants.TOR_DNS_PORT_DEFAULT+"");
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits