diff options
Diffstat (limited to 'hs20')
-rw-r--r-- | hs20/client/Android.mk | 10 | ||||
-rw-r--r-- | hs20/client/osu_client.c | 26 | ||||
-rw-r--r-- | hs20/client/spp_client.c | 1 | ||||
-rw-r--r-- | hs20/server/spp_server.c | 5 |
4 files changed, 30 insertions, 12 deletions
diff --git a/hs20/client/Android.mk b/hs20/client/Android.mk index c42d53cf..bb773413 100644 --- a/hs20/client/Android.mk +++ b/hs20/client/Android.mk @@ -60,6 +60,10 @@ L_CFLAGS += -DEAP_TLS_OPENSSL L_CFLAGS += -Wno-unused-parameter +ifeq ($(shell test $(PLATFORM_VERSION_LAST_STABLE) -ge 8 ; echo $$?), 0) +L_CFLAGS += -DCONFIG_ANDROID_LOG +L_CFLAGS += -DANDROID_LOG_NAME='"hs20-osu-client"' +endif ######################## include $(CLEAR_VARS) @@ -71,9 +75,15 @@ LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := libc libcutils LOCAL_SHARED_LIBRARIES += libcrypto libssl +ifeq ($(shell test $(PLATFORM_VERSION_LAST_STABLE) -ge 8 ; echo $$?), 0) +LOCAL_VENDOR_MODULE := true +LOCAL_SHARED_LIBRARIES += libxml2 +LOCAL_SHARED_LIBRARIES += liblog +else #LOCAL_SHARED_LIBRARIES += libxml2 LOCAL_STATIC_LIBRARIES += libxml2 LOCAL_SHARED_LIBRARIES += libicuuc +endif # End of check for platform version LOCAL_SHARED_LIBRARIES += libcurl LOCAL_CFLAGS := $(L_CFLAGS) diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c index 11bf0db3..7b274dac 100644 --- a/hs20/client/osu_client.c +++ b/hs20/client/osu_client.c @@ -2911,20 +2911,27 @@ static int osu_cert_cb(void *_ctx, struct http_cert *cert) int found; char *host = NULL; - wpa_printf(MSG_INFO, "osu_cert_cb(osu_cert_validation=%d, url=%s)", - !ctx->no_osu_cert_validation, ctx->server_url); + wpa_printf(MSG_INFO, "osu_cert_cb(osu_cert_validation=%d, url=%s server_url=%s)", + !ctx->no_osu_cert_validation, cert->url ? cert->url : "N/A", + ctx->server_url); - host = get_hostname(ctx->server_url); + if (ctx->no_osu_cert_validation && cert->url) + host = get_hostname(cert->url); + else + host = get_hostname(ctx->server_url); - for (i = 0; i < ctx->server_dnsname_count; i++) - os_free(ctx->server_dnsname[i]); - os_free(ctx->server_dnsname); - ctx->server_dnsname = os_calloc(cert->num_dnsname, sizeof(char *)); - ctx->server_dnsname_count = 0; + if (!ctx->no_osu_cert_validation) { + for (i = 0; i < ctx->server_dnsname_count; i++) + os_free(ctx->server_dnsname[i]); + os_free(ctx->server_dnsname); + ctx->server_dnsname = os_calloc(cert->num_dnsname, + sizeof(char *)); + ctx->server_dnsname_count = 0; + } found = 0; for (i = 0; i < cert->num_dnsname; i++) { - if (ctx->server_dnsname) { + if (!ctx->no_osu_cert_validation && ctx->server_dnsname) { ctx->server_dnsname[ctx->server_dnsname_count] = os_strdup(cert->dnsname[i]); if (ctx->server_dnsname[ctx->server_dnsname_count]) @@ -3249,7 +3256,6 @@ int main(int argc, char *argv[]) default: usage(); exit(0); - break; } } diff --git a/hs20/client/spp_client.c b/hs20/client/spp_client.c index 39d10e03..194518e5 100644 --- a/hs20/client/spp_client.c +++ b/hs20/client/spp_client.c @@ -564,7 +564,6 @@ static int hs20_spp_exec(struct hs20_osu_client *ctx, xml_node_t *exec, free(id); return -1; } - return 0; } if (strcasecmp(name, "uploadMO") == 0) { diff --git a/hs20/server/spp_server.c b/hs20/server/spp_server.c index a50e9074..72694be6 100644 --- a/hs20/server/spp_server.c +++ b/hs20/server/spp_server.c @@ -1385,8 +1385,11 @@ static xml_node_t * hs20_subscription_registration(struct hs20_svc *ctx, SUBSCRIPTION_REGISTRATION, mac_addr) < 0) return NULL; val = db_get_osu_config_val(ctx, realm, "signup_url"); - if (val == NULL) + if (!val) { + hs20_eventlog(ctx, NULL, realm, session_id, + "signup_url not configured in osu_config", NULL); return NULL; + } spp_node = build_post_dev_data_response(ctx, &ns, session_id, "OK", NULL); |