File chromium-icu72-2.patch of Package chromium-ffmpeg-extra (Revision b30401c0254353da4e772a68807e8dc6)
Currently displaying revision b30401c0254353da4e772a68807e8dc6 , Show latest
56
1
From 103e1ff08c00590be56c98aa5647e92c7fa78631 Mon Sep 17 00:00:00 2001
2
From: Mustafa Emre Acer <meacer@chromium.org>
3
Date: Fri, 18 Nov 2022 22:52:00 +0000
4
Subject: [PATCH] IDN Spoof Checks: Disallow ZWJ and ZWNJ in ICU versions below
5
72
6
7
ICU 72 updates to Unicode 15 which changes the zero width joiner (ZWJ)
8
and zero width non-joiner (ZWNJ) characters from
9
Identifier_Status=Allowed to Identifier_Status=Restricted. These
10
characters are therefore no longer allowed by default in ICU 72.
11
12
crbug/694157 recently implemented Non-Transitional IDNA 2008 behind a
13
flag. ZWJ and ZWNJ are disallowed in Transitional Mode but allowed in
14
Non-Transitional Mode, so the test cases with the Non-Transitional Mode
15
enabled fail in ICU 72.
16
17
This CL removes ZWJ and ZWNJ from the allowed identifiers set for
18
ICU versions below 72. This effectively disables these characters even
19
in Non-Transitional Mode.
20
21
This is a temporary fix. Once ICU 72 is rolled out, we should check if
22
we can use UIDNA_CHECK_CONTEXTJ and explicitly add ZWJ and ZWNJ to
23
the allowed sets again.
24
25
Bug: 1386204, 694157
26
Change-Id: I606c43b9d94fea0f2331e5aed530f633bb94517c
27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4038542
28
Reviewed-by: Frank Tang <ftang@chromium.org>
29
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
30
Cr-Commit-Position: refs/heads/main@{#1073605}
31
---
32
.../spoof_checks/idn_spoof_checker.cc | 9 ++++++
33
.../idn_spoof_checker_unittest.cc | 28 +++++++++++--------
34
2 files changed, 25 insertions(+), 12 deletions(-)
35
36
Index: chromium-110.0.5481.38/components/url_formatter/spoof_checks/idn_spoof_checker.cc
37
===================================================================
38
--- chromium-110.0.5481.38.orig/components/url_formatter/spoof_checks/idn_spoof_checker.cc
39
+++ chromium-110.0.5481.38/components/url_formatter/spoof_checks/idn_spoof_checker.cc
40
41
allowed_set.remove(0x200Du); // Zero Width Joiner
42
#endif
43
44
+#if U_ICU_VERSION_MAJOR_NUM < 72
45
+ // Unicode 15 changes ZWJ and ZWNJ from allowed to restricted. Restrict them
46
+ // in lower versions too. This only relevant in Non-Transitional Mode as
47
+ // Transitional Mode maps these characters out.
48
+ // TODO(crbug.com/1386204): Remove these after ICU 72 is rolled out.
49
+ allowed_set.remove(0x200Cu); // Zero Width Non-Joiner
50
+ allowed_set.remove(0x200Du); // Zero Width Joiner
51
+#endif
52
+
53
uspoof_setAllowedUnicodeSet(checker_, &allowed_set, status);
54
}
55
56