Commit 9c3e7a29 authored by Toni Beier's avatar Toni Beier

Merge branch 'map_based_ca_certificate_detection' into 'master'

CA certificate detection use map

See merge request !15
parents 512421fd ab9f5a46
Pipeline #22948 failed with stages
in 8 minutes and 19 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];
}
currentWifiConfigurationValues.put(wifiConfigurationValueIdentifier, wifiConfigurationValue);
}
else
{
message="ERROR";
}
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";
} 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