diff options
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-force-punycode-hostnames.patch')
| -rw-r--r-- | www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-force-punycode-hostnames.patch | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-force-punycode-hostnames.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-force-punycode-hostnames.patch deleted file mode 100644 index be26b2c..0000000 --- a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-force-punycode-hostnames.patch +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | # Add flag to force punycode in hostnames instead of Unicode when displaying Internationalized Domain Names (IDNs) to mitigate homograph attacks | ||
| 2 | |||
| 3 | --- chrome/browser/ungoogled_flag_entries.h.orig | ||
| 4 | +++ chrome/browser/ungoogled_flag_entries.h | ||
| 5 | @@ -24,4 +24,8 @@ | ||
| 6 | "Disable beforeunload", | ||
| 7 | "Disables JavaScript dialog boxes triggered by beforeunload. ungoogled-chromium flag.", | ||
| 8 | kOsAll, SINGLE_VALUE_TYPE("disable-beforeunload")}, | ||
| 9 | + {"force-punycode-hostnames", | ||
| 10 | + "Force punycode hostnames", | ||
| 11 | + "Force punycode in hostnames instead of Unicode when displaying Internationalized Domain Names (IDNs). ungoogled-chromium flag.", | ||
| 12 | + kOsAll, SINGLE_VALUE_TYPE("force-punycode-hostnames")}, | ||
| 13 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ | ||
| 14 | --- components/url_formatter/url_formatter.cc.orig | ||
| 15 | +++ components/url_formatter/url_formatter.cc | ||
| 16 | @@ -8,6 +8,7 @@ | ||
| 17 | #include <utility> | ||
| 18 | #include <vector> | ||
| 19 | |||
| 20 | +#include "base/command_line.h" | ||
| 21 | #include "base/lazy_instance.h" | ||
| 22 | #include "base/numerics/safe_conversions.h" | ||
| 23 | #include "base/strings/strcat.h" | ||
| 24 | @@ -264,6 +265,13 @@ IDNConversionResult IDNToUnicodeWithAdju | ||
| 25 | host16.reserve(host.length()); | ||
| 26 | host16.insert(host16.end(), host.begin(), host.end()); | ||
| 27 | |||
| 28 | + if (base::CommandLine::ForCurrentProcess()->HasSwitch("force-punycode-hostnames")) { | ||
| 29 | + // Leave as punycode. | ||
| 30 | + IDNConversionResult result; | ||
| 31 | + result.result = host16; | ||
| 32 | + return result; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | // Compute the top level domain to be used in spoof checks later. | ||
| 36 | base::StringPiece top_level_domain; | ||
| 37 | std::u16string top_level_domain_unicode; | ||
