diff --git a/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java b/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java index 439ae25..d7b1462 100644 --- a/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java +++ b/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java @@ -935,7 +935,7 @@ private void initForm() { }); this.password.addBlurHandler(e -> this.password.validate()); - this.password.setAllowBlank(false); + this.password.setAllowBlank(true); this.password.addMouseOutHandler(event -> resetHelp()); this.buttonPassword.addClickHandler(event -> { @@ -1300,6 +1300,8 @@ private void setPasswordValidation() { this.password.setValidatorsFrom(Optional.empty(), passwordStrengthRequirements); this.password .addValidator(GwtValidators.regex(REGEX_PASS_WEP, MSGS.netWifiWirelessInvalidWEPPassword())); + } else if (this.security != null && this.security.getSelectedItemText().equals(WIFI_SECURITY_NONE_MESSAGE)) { + this.password.setValidators(); } else { passwordStrengthRequirements.allowAnyPassword(); this.password.setValidatorsFrom(Optional.empty(), passwordStrengthRequirements); @@ -1716,6 +1718,7 @@ private boolean checkPassword() { this.groupPassword.setValidationState(ValidationState.ERROR); result = false; } else { + TabWirelessUi.this.helpPassword.setText(""); this.groupPassword.setValidationState(ValidationState.NONE); } diff --git a/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/net2/configuration/NetworkConfigurationServicePropertiesBuilder.java b/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/net2/configuration/NetworkConfigurationServicePropertiesBuilder.java index 328dcca..367168c 100644 --- a/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/net2/configuration/NetworkConfigurationServicePropertiesBuilder.java +++ b/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/net2/configuration/NetworkConfigurationServicePropertiesBuilder.java @@ -30,6 +30,7 @@ import org.eclipse.kura.web.shared.model.GwtNetRouterMode; import org.eclipse.kura.web.shared.model.GwtWifiConfig; import org.eclipse.kura.web.shared.model.GwtWifiNetInterfaceConfig; +import org.eclipse.kura.web.shared.model.GwtWifiSecurity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -234,7 +235,9 @@ private void setWifiMasterProperties() throws GwtKuraException { this.properties.setWifiMasterPassphrase(this.ifname, gwtApConfig.getPassword()); } else { - GwtServerUtil.validateUserPassword(Optional.empty(), gwtWifiConfig.getPassword()); + if (!gwtWifiConfig.getSecurity().equals(GwtWifiSecurity.netWifiSecurityNONE.name())) { + GwtServerUtil.validateUserPassword(Optional.empty(), gwtWifiConfig.getPassword()); + } this.properties.setWifiMasterPassphrase(this.ifname, gwtWifiConfig.getPassword()); } } diff --git a/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/util/GwtServerUtil.java b/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/util/GwtServerUtil.java index 4940fdc..acc0f78 100644 --- a/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/util/GwtServerUtil.java +++ b/bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/server/util/GwtServerUtil.java @@ -771,16 +771,19 @@ public static List replaceNetworkConfigListSensitivePassw if (netConfig instanceof GwtWifiNetInterfaceConfig) { GwtWifiNetInterfaceConfig wifiConfig = (GwtWifiNetInterfaceConfig) netConfig; GwtWifiConfig gwtAPWifiConfig = wifiConfig.getAccessPointWifiConfig(); - if (gwtAPWifiConfig != null) { + if (gwtAPWifiConfig != null && gwtAPWifiConfig.getPassword() != null + && !gwtAPWifiConfig.getPassword().isEmpty()) { gwtAPWifiConfig.setPassword(PASSWORD_PLACEHOLDER); } GwtWifiConfig gwtStationWifiConfig = wifiConfig.getStationWifiConfig(); - if (gwtStationWifiConfig != null) { + if (gwtStationWifiConfig != null && gwtStationWifiConfig.getPassword() != null + && !gwtStationWifiConfig.getPassword().isEmpty()) { gwtStationWifiConfig.setPassword(PASSWORD_PLACEHOLDER); } Gwt8021xConfig gwt8021xConfig = wifiConfig.get8021xConfig(); - if (gwt8021xConfig != null) { + if (gwt8021xConfig != null && gwt8021xConfig.getPassword() != null + && !gwt8021xConfig.getPassword().isEmpty()) { gwt8021xConfig.setPassword(PASSWORD_PLACEHOLDER); }