[PATCH-v2 3/4] hs20-client: Add more debugging messages.

greearb at candelatech.com greearb
Tue Mar 31 17:14:19 PDT 2015


From: Ben Greear <greearb at candelatech.com>

Helps to figure out why some errors happen.

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 hs20/client/osu_client.c | 14 ++++++++++----
 hs20/client/spp_client.c |  3 ++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c
index c3d00c0..0519ef0 100644
--- a/hs20/client/osu_client.c
+++ b/hs20/client/osu_client.c
@@ -547,8 +547,8 @@ int hs20_add_pps_mo(struct hs20_osu_client *ctx, const char *uri,
 	wpa_printf(MSG_INFO, "SP FQDN: %s", fqdn);
 
 	if (!server_dnsname_suffix_match(ctx, fqdn)) {
-		wpa_printf(MSG_INFO, "FQDN '%s' for new PPS MO did not have suffix match with server's dNSName values",
-			   fqdn);
+		wpa_printf(MSG_INFO, "FQDN '%s' for new PPS MO did not have suffix match with server's dNSName values, count: %d",
+			   fqdn, (int)(ctx->server_dnsname_count));
 		write_result(ctx, "FQDN '%s' for new PPS MO did not have suffix match with server's dNSName values",
 			     fqdn);
 		free(fqdn);
@@ -2102,8 +2102,10 @@ static int osu_connect(struct hs20_osu_client *ctx, const char *bssid,
 	}
 
 	ctx->no_reconnect = 1;
-	if (methods & 0x02)
+	if (methods & 0x02) {
+		wpa_printf(MSG_DEBUG, "Calling cmd-prov from osu_connect");
 		res = cmd_prov(ctx, url);
+	}
 	else if (methods & 0x01)
 		res = cmd_oma_dm_prov(ctx, url);
 
@@ -2298,8 +2300,10 @@ selected:
 		}
 
 		if (connect == 2) {
-			if (last->methods & 0x02)
+			if (last->methods & 0x02) {
+				wpa_printf(MSG_DEBUG, "Calling cmd-prov from cmd_osu_select");
 				ret = cmd_prov(ctx, last->url);
+			}
 			else if (last->methods & 0x01)
 				ret = cmd_oma_dm_prov(ctx, last->url);
 			else
@@ -2777,6 +2781,7 @@ static int osu_cert_cb(void *_ctx, struct http_cert *cert)
 		     j < ctx->friendly_name_count; j++) {
 		int found = 0;
 		for (i = 0; i < cert->num_othername; i++) {
+			wpa_printf(MSG_INFO, "othername: %s", (char*)(cert->othername[i].data));
 			if (os_strcmp(cert->othername[i].oid,
 				      "1.3.6.1.4.1.40808.1.1.1") != 0)
 				continue;
@@ -3133,6 +3138,7 @@ int main(int argc, char *argv[])
 			exit(0);
 		}
 		ctx.ca_fname = argv[optind + 2];
+		wpa_printf(MSG_DEBUG, "Calling cmd-prov from main");
 		cmd_prov(&ctx, argv[optind + 1]);
 	} else if (strcmp(argv[optind], "sim_prov") == 0) {
 		if (argc - optind < 2) {
diff --git a/hs20/client/spp_client.c b/hs20/client/spp_client.c
index 302a050..d55095f 100644
--- a/hs20/client/spp_client.c
+++ b/hs20/client/spp_client.c
@@ -952,7 +952,8 @@ int cmd_prov(struct hs20_osu_client *ctx, const char *url)
 		return -1;
 	}
 
-	wpa_printf(MSG_INFO, "Credential provisioning requested");
+	wpa_printf(MSG_INFO, "Credential provisioning requested, url: %s ca-fname: %s",
+		   url, ctx->ca_fname);
 
 	os_free(ctx->server_url);
 	ctx->server_url = os_strdup(url);
-- 
1.9.3




More information about the Hostap mailing list