mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-12 22:11:29 +02:00
dirmngr: Do not rewrite the redirection for the "openpgpkey" subdomain.
* dirmngr/http.c (same_host_p): Consider certain subdomains to be the same. -- GnuPG-bug-id: 4603 Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
cf92f7d96f
commit
37f0c55c7b
@ -3539,6 +3539,10 @@ same_host_p (parsed_uri_t a, parsed_uri_t b)
|
|||||||
{ NULL, "api.protonmail.ch" },
|
{ NULL, "api.protonmail.ch" },
|
||||||
{ "pm.me", "api.protonmail.ch" }
|
{ "pm.me", "api.protonmail.ch" }
|
||||||
};
|
};
|
||||||
|
static const char *subdomains[] =
|
||||||
|
{
|
||||||
|
"openpgpkey."
|
||||||
|
};
|
||||||
int i;
|
int i;
|
||||||
const char *from;
|
const char *from;
|
||||||
|
|
||||||
@ -3560,6 +3564,22 @@ same_host_p (parsed_uri_t a, parsed_uri_t b)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Also consider hosts the same if they differ only in a subdomain;
|
||||||
|
* in both direction. This allows to have redirection between the
|
||||||
|
* WKD advanced and direct lookup methods. */
|
||||||
|
for (i=0; i < DIM (subdomains); i++)
|
||||||
|
{
|
||||||
|
const char *subdom = subdomains[i];
|
||||||
|
size_t subdomlen = strlen (subdom);
|
||||||
|
|
||||||
|
if (!ascii_strncasecmp (a->host, subdom, subdomlen)
|
||||||
|
&& !ascii_strcasecmp (a->host + subdomlen, b->host))
|
||||||
|
return 1;
|
||||||
|
if (!ascii_strncasecmp (b->host, subdom, subdomlen)
|
||||||
|
&& !ascii_strcasecmp (b->host + subdomlen, a->host))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user