Sophie

Sophie

distrib > Mageia > 8 > armv7hl > by-pkgid > 02050c6482d7a6ee468fb957ba7331a5 > files > 22

curl-7.74.0-1.10.mga8.src.rpm

backport of:

From 9e71901634e276dd050481c4320f046bebb1bc28 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 19 Dec 2022 08:36:55 +0100
Subject: [PATCH] http: use the IDN decoded name in HSTS checks

Otherwise it stores the info HSTS into the persistent cache for the IDN
name which will not match when the HSTS status is later checked for
using the decoded name.

Reported-by: Hiroki Kurosawa

Closes #10111
---
 lib/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/http.c b/lib/http.c
index 85528a2218eee..a784745a8d505 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -4015,7 +4015,7 @@ CURLcode Curl_http_header(struct Curl_easy *data, struct connectdata *conn,
     else if(data->hsts && checkprefix("Strict-Transport-Security:", headp) &&
             (conn->handler->flags & PROTOPT_SSL)) {
       CURLcode check =
-        Curl_hsts_parse(data->hsts, data->state.up.hostname,
+        Curl_hsts_parse(data->hsts, conn->host.name,
                         &headp[ sizeof("Strict-Transport-Security:") -1 ]);
       if(check)
         infof(data, "Illegal STS header skipped\n");