aboutsummaryrefslogtreecommitdiffstats
path: root/hs20
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-03-12 18:21:11 -0700
committerVinit Deshpande <vinitd@google.com>2015-03-12 18:21:11 -0700
commit52635714f71d6991c46fb5592a040b1606bd909b (patch)
treed0ffb5987b6901777a01bd70c0303fe0c6509579 /hs20
parent78b4c90a25f65baf75a72b17b48ffa50d309cd75 (diff)
parent7f65602d49069f96a7bb44da8bd79ffe8d4c6a98 (diff)
downloadandroid_external_wpa_supplicant_8-52635714f71d6991c46fb5592a040b1606bd909b.tar.gz
android_external_wpa_supplicant_8-52635714f71d6991c46fb5592a040b1606bd909b.tar.bz2
android_external_wpa_supplicant_8-52635714f71d6991c46fb5592a040b1606bd909b.zip
am "Cumulative patch from commit f51f54a007e0de1d413dee3523472d3bbeed2ecc"
merged from goog/mirror-m-wireless-internal-release 7f65602 Cumulative patch from commit f51f54a007e0de1d413dee3523472d3bbeed2ecc
Diffstat (limited to 'hs20')
-rw-r--r--hs20/client/Android.mk19
-rw-r--r--hs20/client/oma_dm_client.c17
-rw-r--r--hs20/client/osu_client.c22
3 files changed, 49 insertions, 9 deletions
diff --git a/hs20/client/Android.mk b/hs20/client/Android.mk
index 2457e138..b23ac17b 100644
--- a/hs20/client/Android.mk
+++ b/hs20/client/Android.mk
@@ -15,19 +15,21 @@ INCLUDES += external/webkit/Source/WebKit/gtk
# headers to the include path by hand.
ifeq ($(wildcard external/icu),)
INCLUDES += external/icu4c/common
+else
+# The LOCAL_EXPORT_C_INCLUDE_DIRS from ICU did not seem to fully resolve the
+# build (e.g., "mm -B" failed to build, but following that with "mm" allowed
+# the build to complete). For now, add the include directory manually here for
+# Android 5.0.
+ver = $(filter 5.0%,$(PLATFORM_VERSION))
+ifneq (,$(strip $(ver)))
+INCLUDES += external/icu/icu4c/source/common
+endif
endif
-#GTKCFLAGS := $(shell pkg-config --cflags gtk+-2.0 webkit-1.0)
-#GTKLIBS := $(shell pkg-config --libs gtk+-2.0 webkit-1.0)
-#CFLAGS += $(GTKCFLAGS)
-#LIBS += $(GTKLIBS)
-
L_CFLAGS += -DCONFIG_CTRL_IFACE
L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
-L_CFLAGS += -DLIBXML_SCHEMAS_ENABLED
-L_CFLAGS += -DLIBXML_REGEXP_ENABLED
OBJS = spp_client.c
OBJS += oma_dm_client.c
@@ -56,8 +58,7 @@ OBJS += ../../src/crypto/sha256-internal.c
L_CFLAGS += -DEAP_TLS_OPENSSL
-#CFLAGS += $(shell xml2-config --cflags)
-#LIBS += $(shell xml2-config --libs)
+L_CFLAGS += -Wno-unused-parameter
########################
diff --git a/hs20/client/oma_dm_client.c b/hs20/client/oma_dm_client.c
index 82e91062..6eaeeb47 100644
--- a/hs20/client/oma_dm_client.c
+++ b/hs20/client/oma_dm_client.c
@@ -394,6 +394,10 @@ static int oma_dm_exec_browser(struct hs20_osu_client *ctx, xml_node_t *exec)
}
data = xml_node_get_text(ctx->xml, node);
+ if (data == NULL) {
+ wpa_printf(MSG_INFO, "Invalid data");
+ return DM_RESP_BAD_REQUEST;
+ }
wpa_printf(MSG_INFO, "Data: %s", data);
wpa_printf(MSG_INFO, "Launch browser to URI '%s'", data);
write_summary(ctx, "Launch browser to URI '%s'", data);
@@ -428,6 +432,10 @@ static int oma_dm_exec_get_cert(struct hs20_osu_client *ctx, xml_node_t *exec)
}
data = xml_node_get_text(ctx->xml, node);
+ if (data == NULL) {
+ wpa_printf(MSG_INFO, "Invalid data");
+ return DM_RESP_BAD_REQUEST;
+ }
wpa_printf(MSG_INFO, "Data: %s", data);
getcert = xml_node_from_buf(ctx->xml, data);
xml_node_get_text_free(ctx->xml, data);
@@ -576,6 +584,11 @@ static int oma_dm_run_add(struct hs20_osu_client *ctx, const char *locuri,
if (node) {
char *type;
type = xml_node_get_text(ctx->xml, node);
+ if (type == NULL) {
+ wpa_printf(MSG_ERROR, "Could not find type text");
+ os_free(uri);
+ return DM_RESP_BAD_REQUEST;
+ }
use_tnds = node &&
os_strstr(type, "application/vnd.syncml.dmtnds+xml");
}
@@ -648,6 +661,10 @@ static int oma_dm_add(struct hs20_osu_client *ctx, xml_node_t *add,
return DM_RESP_BAD_REQUEST;
}
locuri = xml_node_get_text(ctx->xml, node);
+ if (locuri == NULL) {
+ wpa_printf(MSG_ERROR, "No LocURI node text found");
+ return DM_RESP_BAD_REQUEST;
+ }
wpa_printf(MSG_INFO, "Target LocURI: %s", locuri);
if (os_strncasecmp(locuri, "./Wi-Fi/", 8) != 0) {
wpa_printf(MSG_INFO, "Unsupported Add Target LocURI");
diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index e452aa70..de7f351d 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -9,6 +9,9 @@
#include "includes.h"
#include <time.h>
#include <sys/stat.h>
+#ifdef ANDROID
+#include "private/android_filesystem_config.h"
+#endif /* ANDROID */
#include "common.h"
#include "utils/browser.h"
@@ -571,6 +574,21 @@ int hs20_add_pps_mo(struct hs20_osu_client *ctx, const char *uri,
}
}
+#ifdef ANDROID
+ /* Allow processes running with Group ID as AID_WIFI,
+ * to read files from SP/<fqdn> directory */
+ if (chown(fname, -1, AID_WIFI)) {
+ wpa_printf(MSG_INFO, "CTRL: Could not chown directory: %s",
+ strerror(errno));
+ /* Try to continue anyway */
+ }
+ if (chmod(fname, S_IRWXU | S_IRGRP | S_IXGRP) < 0) {
+ wpa_printf(MSG_INFO, "CTRL: Could not chmod directory: %s",
+ strerror(errno));
+ /* Try to continue anyway */
+ }
+#endif /* ANDROID */
+
snprintf(fname, fname_len, "SP/%s/pps.xml", fqdn);
if (os_file_exists(fname)) {
@@ -669,6 +687,10 @@ int update_pps_file(struct hs20_osu_client *ctx, const char *pps_fname,
wpa_printf(MSG_INFO, "Updating PPS MO %s", pps_fname);
str = xml_node_to_str(ctx->xml, pps);
+ if (str == NULL) {
+ wpa_printf(MSG_ERROR, "No node found");
+ return -1;
+ }
wpa_printf(MSG_MSGDUMP, "[hs20] Updated PPS: '%s'", str);
snprintf(backup, sizeof(backup), "%s.bak", pps_fname);