Commit ab9f5a46 authored by Toni Beier's avatar Toni Beier

CA certificate detection use map

parent 9cb21884
Pipeline #22876 passed with stages
in 3 minutes and 57 seconds
......@@ -47,9 +47,11 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Stream;
class Helper {
......@@ -646,26 +648,31 @@ class Helper {
}
list.add(new MainActivity.TickLine(ticked, message, "EAP Methode", true));
int nullpoint;
nullpoint=currentConfig.enterpriseConfig.toString().indexOf("ca_cert NULL");
if (nullpoint==-1){
int start,finish;
start=currentConfig.enterpriseConfig.toString().indexOf("ca_cert");
finish=currentConfig.enterpriseConfig.toString().indexOf("\"", start+10);
if (start>0 && finish>0) {
message="OK";
ticked = true;
Map<String, String> currentWifiConfigurationValues = new HashMap<>();
for (String wifiConfigurationLine : currentConfig.enterpriseConfig.toString().split(String.valueOf('\n'))) {
String wifiConfigurationValueIdentifier = null;
String wifiConfigurationValue = null;
String[] wifiConfigurationLineSegments = wifiConfigurationLine.split(String.valueOf(' '));
if (wifiConfigurationLineSegments.length >= 1) {
wifiConfigurationValueIdentifier = wifiConfigurationLineSegments[0];
if (wifiConfigurationLineSegments.length >= 2) {
wifiConfigurationValue = wifiConfigurationLineSegments[1];
}
else
{
message="ERROR";
ticked = false;
currentWifiConfigurationValues.put(wifiConfigurationValueIdentifier, wifiConfigurationValue);
}
}
else
{
message="Not found";
if (currentWifiConfigurationValues.containsKey("ca_cert")) {
String currentWifiConfigurationCaCertValue = currentWifiConfigurationValues.get("ca_cert");
if (currentWifiConfigurationCaCertValue != null) {
message = "OK";
ticked = true;
} else {
message = "ERROR";
ticked = false;
}
} else {
message = "Not found";
ticked = false;
}
list.add(new MainActivity.TickLine(ticked, message, "CA Certificate", true));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment