#define CONNMAN_CONFIG_FIELD_SSID "SSID"
#define CONNMAN_CONFIG_FIELD_EAP_METHOD "EAP"
#define CONNMAN_CONFIG_FIELD_IDENTITY "Identity"
+#define CONNMAN_CONFIG_FIELD_ANONYMOUS_IDENTITY "AnonymousIdentity"
#define CONNMAN_CONFIG_FIELD_PASSPHRASE "Passphrase"
#define CONNMAN_CONFIG_FIELD_PHASE2 "Phase2"
#define CONNMAN_CONFIG_FIELD_CA_CERT_FILE "CACertFile"
char *eap_type;
char *eap_auth;
char *identity;
+ char *anonymous_identity;
char *password;
char *ca_cert_file;
char *client_cert_file;
typedef struct {
char username[NET_WLAN_USERNAME_LEN+1]; /** User name */
char password[NET_WLAN_PASSWORD_LEN+1]; /** Password */
+ char anonymous_identity[NET_WLAN_USERNAME_LEN+1]; /** AnonymousIdentity */
/**
* Following fields are mandatory for EAP-TLS,
int wifi_manager_ap_get_eap_passphrase(wifi_manager_ap_h ap, char **user_name, bool *is_password_set);
/**
+ * @brief Sets access point anonymous identity.
+ * @since_tizen 5.5
+ * @param[in] ap The access point handle
+ * @param[in] anonymous_identity The anonymous identity
+ * @return 0 on success, otherwise negative error value
+ * @retval #WIFI_MANAGER_ERROR_NONE Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #WIFI_ERROR_NOT_SUPPORTED Not supported
+ */
+int wifi_manager_ap_set_eap_anonymous_identity(wifi_manager_ap_h ap, const char *anonymous_identity);
+
+/**
+ * @brief Gets access point anonymous identity.
+ * @since_tizen 5.5
+ * @remarks You must release @a anonymous_identity using free().
+ * @param[in] ap The access point handle
+ * @param[out] anonymous_identity The anonymous identity of access point
+ * @return 0 on success, otherwise negative error value
+ * @retval #WIFI_MANAGER_ERROR_NONE Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WIFI_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #WIFI_ERROR_NOT_SUPPORTED Not supported
+ */
+int wifi_manager_ap_get_eap_anonymous_identity(wifi_manager_ap_h ap, char **anonymous_identity);
+
+/**
* @brief Gets the CA Certificate of EAP.
* @since_tizen 3.0
* @remarks This function is valid only if the EAP type is #WIFI_MANAGER_EAP_TYPE_TLS.
g_variant_builder_add(builder, "{ss}",
CONNMAN_CONFIG_FIELD_IDENTITY, wifi_info->identity);
+ if (wifi_info->anonymous_identity)
+ g_variant_builder_add(builder, "{ss}",
+ CONNMAN_CONFIG_FIELD_ANONYMOUS_IDENTITY, wifi_info->anonymous_identity);
+
if (wifi_info->password)
g_variant_builder_add(builder, "{ss}",
CONNMAN_CONFIG_FIELD_PASSPHRASE, wifi_info->password);
if (wifi_info->security_info.authentication.eap.private_key_passwd[0] != '\0')
wifi_connection_info.private_key_password =
(char *)wifi_info->security_info.authentication.eap.private_key_passwd;
+
+ if (wifi_info->security_info.authentication.eap.anonymous_identity[0] != '\0')
+ wifi_connection_info.anonymous_identity =
+ (char *)wifi_info->security_info.authentication.eap.anonymous_identity;
break;
default:
return WIFI_MANAGER_ERROR_NONE;
}
+EXPORT_API int wifi_manager_ap_set_eap_anonymous_identity(wifi_manager_ap_h ap, const char *anonymous_identity)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ if (_wifi_check_ap_validity(ap) == false || anonymous_identity == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
+ __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ }
+
+ net_profile_info_s *profile_info = ap;
+ if (profile_info->security_info.sec_mode != WLAN_SEC_MODE_IEEE8021X) {
+ __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE
+ }
+
+ g_strlcpy(profile_info->security_info.authentication.eap.anonymous_identity,
+ anonymous_identity, NET_WLAN_USERNAME_LEN+1);
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
+EXPORT_API int wifi_manager_ap_get_eap_anonymous_identity(wifi_manager_ap_h ap, char **anonymous_identity)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ if (_wifi_check_ap_validity(ap) == false || anonymous_identity == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
+ __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ }
+
+ net_profile_info_s *profile_info = ap;
+ if (profile_info->security_info.sec_mode != WLAN_SEC_MODE_IEEE8021X) {
+ __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_INVALID_OPERATION; //LCOV_EXCL_LINE
+ }
+
+ *anonymous_identity = strdup(profile_info->security_info.authentication.eap.anonymous_identity);
+ if (*anonymous_identity == NULL) {
+ __NETWORK_CAPI_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
+ }
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
EXPORT_API int wifi_manager_ap_get_eap_ca_cert_file(wifi_manager_ap_h ap, char **file)
{
__NETWORK_CAPI_FUNC_ENTER__;