DBG("address %s security %s", address, security);
- if (security == NULL && passphrase == NULL)
+ if (security == NULL)
return -EINVAL;
- if (g_str_equal(security, "none") == FALSE && passphrase == NULL)
+ if (passphrase == NULL && g_str_equal(security, "none") == FALSE &&
+ g_str_equal(security, "ieee8021x") == FALSE)
return -EINVAL;
remove_network(task);
str = g_key_file_get_string(keyfile, group, "Name", NULL);
if (str != NULL) {
- g_free(service->type);
+ g_free(service->name);
service->name = str;
}
__connman_service_set_immutable(service, TRUE);
__connman_service_set_favorite(service, TRUE);
- if (config->eap)
+ if (config->eap != NULL)
__connman_service_set_string(service, "EAP", config->eap);
- if (config->identity)
+ if (config->identity != NULL)
__connman_service_set_string(service, "Identity",
config->identity);
- if (config->ca_cert_file)
+ if (config->ca_cert_file != NULL)
__connman_service_set_string(service, "CACertFile",
config->ca_cert_file);
- if (config->client_cert_file)
+ if (config->client_cert_file != NULL)
__connman_service_set_string(service, "ClientCertFile",
config->client_cert_file);
- if (config->private_key_file)
+ if (config->private_key_file != NULL)
__connman_service_set_string(service, "PrivateKeyFile",
config->private_key_file);
if (g_strcmp0(config->private_key_passphrase_type, "fsid") == 0 &&
- config->private_key_file) {
+ config->private_key_file != NULL) {
char *fsid;
fsid = config_pem_fsid(config->private_key_file);
config->private_key_passphrase = fsid;
}
- if (config->private_key_passphrase) {
+ if (config->private_key_passphrase != NULL) {
__connman_service_set_string(service, "PrivateKeyPassphrase",
config->private_key_passphrase);
/*
* service passphrase in order for the UI to request for an
* additional passphrase.
*/
- __connman_service_set_string(service, "Passphrase",
- config->private_key_passphrase);
}
- if (config->phase2)
+ if (config->phase2 != NULL)
__connman_service_set_string(service, "Phase2", config->phase2);
}
case CONNMAN_SERVICE_SECURITY_PSK:
case CONNMAN_SERVICE_SECURITY_WPA:
case CONNMAN_SERVICE_SECURITY_RSN:
- case CONNMAN_SERVICE_SECURITY_8021X:
if (service->passphrase == NULL)
required = TRUE;
break;
+ case CONNMAN_SERVICE_SECURITY_8021X:
+ break;
}
break;
}
case CONNMAN_SERVICE_SECURITY_PSK:
case CONNMAN_SERVICE_SECURITY_WPA:
case CONNMAN_SERVICE_SECURITY_RSN:
- case CONNMAN_SERVICE_SECURITY_8021X:
if (service->passphrase == NULL)
required = TRUE;
break;
+ case CONNMAN_SERVICE_SECURITY_8021X:
+ break;
}
connman_dbus_dict_append_basic(&dict, "PassphraseRequired",
static void prepare_8021x(struct connman_service *service)
{
- if (service->eap)
+ if (service->eap != NULL)
connman_network_set_string(service->network, "WiFi.EAP",
service->eap);
- if (service->identity)
+ if (service->identity != NULL)
connman_network_set_string(service->network, "WiFi.Identity",
service->identity);
- if (service->ca_cert_file)
+ if (service->ca_cert_file != NULL)
connman_network_set_string(service->network, "WiFi.CACertFile",
service->ca_cert_file);
- if (service->client_cert_file)
+ if (service->client_cert_file != NULL)
connman_network_set_string(service->network,
"WiFi.ClientCertFile",
service->client_cert_file);
- if (service->private_key_file)
+ if (service->private_key_file != NULL)
connman_network_set_string(service->network,
"WiFi.PrivateKeyFile",
service->private_key_file);
- if (service->private_key_passphrase)
+ if (service->private_key_passphrase != NULL)
connman_network_set_string(service->network,
"WiFi.PrivateKeyPassphrase",
service->private_key_passphrase);
- if (service->phase2)
+ if (service->phase2 != NULL)
connman_network_set_string(service->network, "WiFi.Phase2",
service->phase2);
}
case CONNMAN_SERVICE_SECURITY_PSK:
case CONNMAN_SERVICE_SECURITY_WPA:
case CONNMAN_SERVICE_SECURITY_RSN:
- case CONNMAN_SERVICE_SECURITY_8021X:
if (service->passphrase == NULL)
return -ENOKEY;
break;
+ case CONNMAN_SERVICE_SECURITY_8021X:
+ break;
}
break;
}