From: Tobias Brunner Date: Fri, 17 Nov 2017 16:40:52 +0000 (+0100) Subject: android: Validate proposal strings in the GUI X-Git-Tag: 5.6.2dr1~4^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f962f6c1917551fa99904f81687c042345c0f0b;p=thirdparty%2Fstrongswan.git android: Validate proposal strings in the GUI --- diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java index 6ba8f80fb8..37c5b3357f 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java @@ -70,6 +70,7 @@ import org.strongswan.android.ui.adapter.CertificateIdentitiesAdapter; import org.strongswan.android.ui.widget.TextInputLayoutHelper; import org.strongswan.android.utils.Constants; import org.strongswan.android.utils.IPRangeSet; +import org.strongswan.android.utils.Utils; import java.security.cert.X509Certificate; import java.util.ArrayList; @@ -653,6 +654,16 @@ public class VpnProfileDetailActivity extends AppCompatActivity Constants.NAT_KEEPALIVE_MIN, Constants.NAT_KEEPALIVE_MAX)); valid = false; } + if (!validateProposal(mIkeProposal, true)) + { + mIkeProposalWrap.setError(getString(R.string.alert_text_no_proposal)); + valid = false; + } + if (!validateProposal(mEspProposal, false)) + { + mEspProposalWrap.setError(getString(R.string.alert_text_no_proposal)); + valid = false; + } return valid; } @@ -845,6 +856,17 @@ public class VpnProfileDetailActivity extends AppCompatActivity return value.isEmpty() || IPRangeSet.fromString(value) != null; } + /** + * Check that the value in the given text box is a valid proposal + * + * @param view text box + */ + private boolean validateProposal(EditText view, boolean ike) + { + String value = view.getText().toString().trim(); + return value.isEmpty() || Utils.isProposalValid(ike, value); + } + private class SelectUserCertOnClickListener implements OnClickListener, KeyChainAliasCallback { @Override diff --git a/src/frontends/android/app/src/main/res/values-de/strings.xml b/src/frontends/android/app/src/main/res/values-de/strings.xml index 93eeb2a51a..49a0ab411e 100644 --- a/src/frontends/android/app/src/main/res/values-de/strings.xml +++ b/src/frontends/android/app/src/main/res/values-de/strings.xml @@ -119,6 +119,7 @@ Bitte wählen Sie eines aus oder aktivieren Sie Automatisch wählen Bitte geben Sie eine Nummer von %1$d - %2$d ein Bitte geben Sie mit Leerzeichen getrennte, gültige Subnetzte und/oder IP-Adressen ein + Bitte geben Sie eine mit Bindestrichen getrennte, gültige Liste von Algorithmen ein EAP-TNC kann Ihre Privatsphäre beeinträchtigen Gerätedaten werden an den Server-Betreiber gesendet Trusted Network Connect (TNC) erlaubt Server-Betreibern den Gesundheitszustand von Endgeräten zu prüfen.

Dazu kann der Betreiber Daten verlangen, wie etwa eine eindeutige Identifikationsnummer, eine Liste der installierten Pakete, Systemeinstellungen oder kryptografische Prüfsummen von Dateien.

Solche Daten werden nur übermittelt nachdem die Identität des Servers geprüft wurde.]]>
diff --git a/src/frontends/android/app/src/main/res/values-pl/strings.xml b/src/frontends/android/app/src/main/res/values-pl/strings.xml index cc48a9b282..61fd3f09ee 100644 --- a/src/frontends/android/app/src/main/res/values-pl/strings.xml +++ b/src/frontends/android/app/src/main/res/values-pl/strings.xml @@ -119,6 +119,7 @@ Wybierz lub uaktywnij jeden Wybierz automatycznie Please enter a number in the range from %1$d - %2$d Please enter valid subnets and/or IP addresses, separated by spaces + Please enter a valid list of algorithms, separated by hyphens EAP-TNC may affect your privacy Device data is sent to the server operator Trusted Network Connect (TNC) allows server operators to assess the health of a client device.

For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.

Any data will be sent only after verifying the server\'s identity.]]>
diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml index a422300993..a2b3ada45d 100644 --- a/src/frontends/android/app/src/main/res/values-ru/strings.xml +++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml @@ -116,6 +116,7 @@ Пожалуйста выберите один Выбрать автоматически Please enter a number in the range from %1$d - %2$d Please enter valid subnets and/or IP addresses, separated by spaces + Please enter a valid list of algorithms, separated by hyphens EAP-TNC may affect your privacy Device data is sent to the server operator Trusted Network Connect (TNC) allows server operators to assess the health of a client device.

For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.

Any data will be sent only after verifying the server\'s identity.]]>
diff --git a/src/frontends/android/app/src/main/res/values-ua/strings.xml b/src/frontends/android/app/src/main/res/values-ua/strings.xml index 3f4a4c62f0..bfe4719cda 100644 --- a/src/frontends/android/app/src/main/res/values-ua/strings.xml +++ b/src/frontends/android/app/src/main/res/values-ua/strings.xml @@ -117,6 +117,7 @@ Будь ласка виберіть один Вибрати автоматично Please enter a number in the range from %1$d - %2$d Please enter valid subnets and/or IP addresses, separated by spaces + Please enter a valid list of algorithms, separated by hyphens EAP-TNC may affect your privacy Device data is sent to the server operator Trusted Network Connect (TNC) allows server operators to assess the health of a client device.

For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.

Any data will be sent only after verifying the server\'s identity.]]>
diff --git a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml index 7d0d529a42..bda7324437 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rCN/strings.xml @@ -116,6 +116,7 @@ 请选择一项或激活 自动选择 请输入一个数字范围从%1$d到%2$d Please enter valid subnets and/or IP addresses, separated by spaces + Please enter a valid list of algorithms, separated by hyphens EAP-TNC可能会影响您的隐私 设备数据已被发送至服务器管理员 Trusted Network Connect (TNC) 允许服务器管理员评定一个用户设备的状况。

出于此目的,服务器管理员可能要求以下数据如独立ID、已安装软件列表、系统设置、或加密过的文件校验值。

任何数据都仅将在验证过服务器的身份ID之后被发出。]]>
diff --git a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml index 4e87530a98..2d49923335 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rTW/strings.xml @@ -116,6 +116,7 @@ 請選擇一項或啟動 自動選擇 請輸入一個數字範圍從%1$d到%2$d Please enter valid subnets and/or IP addresses, separated by spaces + Please enter a valid list of algorithms, separated by hyphens EAP-TNC可能會影響您的隱私安全 裝置資料已經發送給伺服器管理者 Trusted Network Connect (TNC) 可以讓伺服器管理者評估用戶裝置的狀況。

在這個目的下,伺服器管理者可能會要求以下資料,例如ID、已安裝的App項目、系統設定、或加密檔案驗證值。

任何資料都只有在驗證伺服器的身分ID之後才會被送出。]]>
diff --git a/src/frontends/android/app/src/main/res/values/strings.xml b/src/frontends/android/app/src/main/res/values/strings.xml index c51f373ea9..dd22d3be71 100644 --- a/src/frontends/android/app/src/main/res/values/strings.xml +++ b/src/frontends/android/app/src/main/res/values/strings.xml @@ -119,6 +119,7 @@ Please select one or activate Select automatically Please enter a number in the range from %1$d - %2$d Please enter valid subnets and/or IP addresses, separated by spaces + Please enter a valid list of algorithms, separated by hyphens EAP-TNC may affect your privacy Device data is sent to the server operator Trusted Network Connect (TNC) allows server operators to assess the health of a client device.

For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.

Any data will be sent only after verifying the server\'s identity.]]>