]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hs20-osu-client: Allow EST server to use different host name
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 11 Mar 2022 17:47:30 +0000 (19:47 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 11 Mar 2022 17:47:30 +0000 (19:47 +0200)
The EST server does not have to be sharing the same host name with the
OSU server. Use the host name from the EST URL instead of the SPP server
URL when validating the EST server certificate.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
hs20/client/osu_client.c

index bf78548a914ec62d0f8fe53f0a4f4dbac1b1951d..7ab2a37463fbb00d9154fcfb3184bc99c2cd9e59 100644 (file)
@@ -2911,10 +2911,14 @@ 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]);