DA: If ProfileErrorState is invalid-key, require password and do not net_open_connection 89/283489/3
authorJaehyun Kim <jeik01.kim@samsung.com>
Thu, 27 Oct 2022 13:05:19 +0000 (22:05 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Thu, 27 Oct 2022 13:08:37 +0000 (22:08 +0900)
Change-Id: Ia33c7bca9403d822313e2ef925f3d8a1a7fe1c31
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/wifi_ap.c
src/wifi_internal.c

index a4c6c3e..f00dcd1 100644 (file)
@@ -1970,6 +1970,13 @@ EXPORT_API int wifi_manager_ap_is_passphrase_required(wifi_manager_ap_h ap,
 
        net_profile_info_s *profile_info = ap;
 
+       if (profile_info->ProfileErrorState == NET_STATE_ERROR_INVALID_KEY) {
+               WIFI_LOG(WIFI_INFO, "This profile saved passphrase is wrong, require passphrase");
+               *required = true;
+               __NETWORK_CAPI_FUNC_EXIT__;
+               return WIFI_MANAGER_ERROR_NONE;
+       }
+
        if (profile_info->Favourite) {
                *required = false;
                __NETWORK_CAPI_FUNC_EXIT__;
index 77cf5ae..7666993 100644 (file)
@@ -2816,7 +2816,8 @@ int _wifi_open_profile(wifi_manager_h wifi, wifi_manager_ap_h ap_h,
        wifi_manager_handle_s *wifi_handle = wifi;
 
        valid_profile = _wifi_check_profile_name_validity(ap_info->ProfileName);
-       if (valid_profile == true && ap_info->Favourite)
+       if (valid_profile == true && ap_info->Favourite &&
+                       ap_info->ProfileErrorState != NET_STATE_ERROR_INVALID_KEY)
                rv = net_open_connection(wifi_handle->network_info, ap_info->ProfileName);
        else if (valid_profile == true &&
                        ap_info->is_hidden != TRUE &&