Added support of SAE security mode. 88/208288/1
authorMayank Haarit <mayank.h@samsung.com>
Fri, 21 Jun 2019 06:25:30 +0000 (11:55 +0530)
committerMayank Haarit <mayank.h@samsung.com>
Fri, 21 Jun 2019 06:25:30 +0000 (11:55 +0530)
Change-Id: I2e2321bce63af792b23798fb0fb78acfbc76ed1d
Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
include/tethering.h
include/tethering_private.h
src/tethering.c
test/tethering_test.c

index a1a466e..ce2bd87 100644 (file)
@@ -102,6 +102,7 @@ typedef enum {
     TETHERING_WIFI_SECURITY_TYPE_NONE = 0,  /**< No Security type */
     TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK,  /**< WPA2_PSK */
        TETHERING_WIFI_SECURITY_TYPE_WPS,  /**< WPA2_PSK */
+       TETHERING_WIFI_SECURITY_TYPE_SAE,  /**< SAE */
 } tethering_wifi_security_type_e;
 
 /**
index b555868..69e12bf 100644 (file)
@@ -251,6 +251,7 @@ typedef enum {
 #define TETHERING_WIFI_SECURITY_TYPE_OPEN_STR          "open"
 #define TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK_STR      "wpa2-psk"
 #define TETHERING_WIFI_SECURITY_TYPE_WPS_STR   "wps"
+#define TETHERING_WIFI_SECURITY_TYPE_SAE_STR   "sae"
 #define TETHERING_ERROR_RECOVERY_MAX                   3
 #define SECURITY_TYPE_LEN      32
 #define PSK_ITERATION_COUNT    4096
index 0e1b1df..46c8168 100755 (executable)
@@ -161,7 +161,8 @@ static tethering_error_e __set_security_type(const tethering_wifi_security_type_
 {
        if (security_type != TETHERING_WIFI_SECURITY_TYPE_NONE &&
                        security_type != TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK &&
-                       security_type != TETHERING_WIFI_SECURITY_TYPE_WPS) {
+                       security_type != TETHERING_WIFI_SECURITY_TYPE_WPS &&
+                       security_type != TETHERING_WIFI_SECURITY_TYPE_SAE) {
                ERR("Invalid param\n"); //LCOV_EXCL_LINE
                return TETHERING_ERROR_INVALID_PARAMETER;
        }
@@ -687,6 +688,8 @@ static void __handle_security_type_changed(GDBusConnection *connection, const gc
                security_type = TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK;
        else if (g_strcmp0(buf, TETHERING_WIFI_SECURITY_TYPE_WPS_STR) == 0)
                security_type = TETHERING_WIFI_SECURITY_TYPE_WPS;
+       else if (g_strcmp0(buf, TETHERING_WIFI_SECURITY_TYPE_SAE_STR) == 0)
+               security_type = TETHERING_WIFI_SECURITY_TYPE_SAE;
        else {
                SERR("Unknown type : %s\n", buf); //LCOV_EXCL_LINE
                g_free(buf);
@@ -2909,6 +2912,9 @@ API int tethering_wifi_set_security_type(tethering_h tethering, tethering_wifi_s
                case TETHERING_WIFI_SECURITY_TYPE_WPS:
                        sec_str = TETHERING_WIFI_SECURITY_TYPE_WPS_STR;
                        break;
+               case TETHERING_WIFI_SECURITY_TYPE_SAE:
+                       sec_str = TETHERING_WIFI_SECURITY_TYPE_SAE_STR;
+                       break;
                }
 
                __send_dbus_signal(th->client_bus,
index 0ba2f81..9c153ff 100755 (executable)
@@ -432,6 +432,9 @@ static void __security_type_changed_cb(tethering_wifi_security_type_e changed_ty
        case TETHERING_WIFI_SECURITY_TYPE_WPS:
                sec_str = "wps";
                break;
+       case TETHERING_WIFI_SECURITY_TYPE_SAE:
+               sec_str = "sae";
+               break;
        default:
                sec_str = "unknown";
                break;
@@ -557,6 +560,9 @@ static void __print_wifi_tethering_setting(tethering_h th)
                case TETHERING_WIFI_SECURITY_TYPE_WPS:
                        sec_str = "wps";
                        break;
+               case TETHERING_WIFI_SECURITY_TYPE_SAE:
+                       sec_str = "sae";
+                       break;
                default:
                        sec_str = "unknown";
                        break;
@@ -797,7 +803,7 @@ static int test_tethering_wifi_set_security_type(void)
        int ret;
        int security_type;
 
-       printf("Input security type for Wi-Fi tethering (0:NONE, 1:WPA2_PSK, 2:WPS)");
+       printf("Input security type for Wi-Fi tethering (0:NONE, 1:WPA2_PSK, 2:WPS, 3:SAE)");
        ret = scanf("%9d", &security_type);
        if (ret < 0) {
                printf("scanf is failed!!\n");