diff options
| author | Werner Koch <[email protected]> | 2019-07-12 11:57:00 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2019-07-12 11:57:00 +0000 |
| commit | a5118b19c182b558635a6a11ef55b6b8a18c04e9 (patch) | |
| tree | 16f59401d004b086e1a00c7dad8e4a7523af2fae /dirmngr/http.c | |
| parent | Merge branch 'master' into switch-to-gpgk (diff) | |
| parent | scd: Remove useless GNUPG_SCD_MAIN_HEADER macro. (diff) | |
| download | gnupg-a5118b19c182b558635a6a11ef55b6b8a18c04e9.tar.gz gnupg-a5118b19c182b558635a6a11ef55b6b8a18c04e9.zip | |
Merge branch 'master' into switch-to-gpgk
Diffstat (limited to 'dirmngr/http.c')
| -rw-r--r-- | dirmngr/http.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/dirmngr/http.c b/dirmngr/http.c index d6856fe05..81b7ba897 100644 --- a/dirmngr/http.c +++ b/dirmngr/http.c @@ -3536,8 +3536,13 @@ same_host_p (parsed_uri_t a, parsed_uri_t b) { "protonmail.com", "api.protonmail.com" }, { NULL, "api.protonmail.ch" }, { "protonmail.ch", "api.protonmail.com" }, - { NULL, "api.protonmail.ch" } + { NULL, "api.protonmail.ch" }, + { "pm.me", "api.protonmail.ch" } }; + static const char *subdomains[] = + { + "openpgpkey." + }; int i; const char *from; @@ -3559,6 +3564,22 @@ same_host_p (parsed_uri_t a, parsed_uri_t b) 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; } |
