Fixed security issues from SSMS 50/191450/5
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 17 Oct 2018 07:51:08 +0000 (16:51 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Thu, 18 Oct 2018 07:09:50 +0000 (16:09 +0900)
- 181016-0003: wmeshd, print 'passphrase' out.
- 181016-0004: Error during parsing SSID has '=' character.

Change-Id: I67509ae968aed6716f5ae3d286b1fcc0d7634ff3
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
src/wmesh-service-interface.c
src/wmesh-softap.c

index 684e581..71bbbeb 100644 (file)
@@ -712,8 +712,6 @@ static gboolean _wmeshd_dbus_handle_get_softap(NetWmesh *object,
        WMESH_LOGD("channel   : %d", channel);
        WMESH_LOGD("visibility: %d", visibility);
        WMESH_LOGD("max_sta   : %d", max_sta);
-       WMESH_LOGD("security  : %d", security);
-       WMESH_LOGD("Passphrase  : %s", passphrase ? passphrase : "NULL");
 
        if (security == 1)
                net_wmesh_complete_get_softap(object, invocation, ssid, mode, channel,
index cd7d469..63d7b79 100644 (file)
@@ -328,23 +328,23 @@ static int __read_hostapd_config(char **softap_interface, char **ssid,
                        buf[ln] = '\0';
 
                if (strncmp(buf, "interface", strlen("interface")) == 0) {
-                       *softap_interface = g_strdup(strrchr(buf, '=') + 1);
+                       *softap_interface = g_strdup(strchr(buf, '=') + 1);
                        WMESH_LOGD("Interface: %s", *softap_interface);
                } else if (strncmp(buf, "ssid", strlen("ssid")) == 0) {
-                       *ssid = g_strdup(strrchr(buf, '=') + 1);
+                       *ssid = g_strdup(strchr(buf, '=') + 1);
                        WMESH_LOGD("SSID: %s", *ssid);
                } else if (strncmp(buf, "hw_mode", strlen("hw_mode")) == 0) {
-                       *mode = g_strdup(strrchr(buf, '=') + 1);
+                       *mode = g_strdup(strchr(buf, '=') + 1);
                        WMESH_LOGD("Mode: %s", *mode);
                } else if (strncmp(buf, "channel", strlen("channel")) == 0) {
-                       *channel = atoi(strrchr(buf, '=') + 1);
+                       *channel = atoi(strchr(buf, '=') + 1);
                        WMESH_LOGD("Channel: %d", *channel);
                } else if (strncmp(buf, "ignore_broadcast_ssid",
                                                   strlen("ignore_broadcast_ssid")) == 0) {
-                       *visibility = atoi(strrchr(buf, '=') + 1) == 0 ? 1 : 0;
+                       *visibility = atoi(strchr(buf, '=') + 1) == 0 ? 1 : 0;
                        WMESH_LOGD("Visibility: %d", *visibility);
                } else if (strncmp(buf, "max_num_sta", strlen("max_num_sta")) == 0) {
-                       *max_sta = atoi(strrchr(buf, '=') + 1);
+                       *max_sta = atoi(strchr(buf, '=') + 1);
                        WMESH_LOGD("Max Station: %d", *max_sta);
                } else if (strncmp(buf, "wpa=", strlen("wpa=")) == 0) {
                        *security = 1;
@@ -355,8 +355,7 @@ static int __read_hostapd_config(char **softap_interface, char **ssid,
                                len = 0;
                        }
                        *passphrase = g_strdup(passphrase_buf);
-                       WMESH_LOGD("Security: %d", *security);
-                       WMESH_LOGD("Passphrase: %s", *passphrase);
+
                }
        }