diff options
| author | Robert Pluim | 2024-09-17 15:19:01 +0200 |
|---|---|---|
| committer | Robert Pluim | 2024-09-17 15:50:27 +0200 |
| commit | 7d365a2d72d8e656262205827cc5fdf423c3a41f (patch) | |
| tree | 6c2a1539a304281b51b7de63d7b3dcef16a9ad89 /admin | |
| parent | 8eb66cca78dca27d58a8881b587b3340043a74f7 (diff) | |
| download | emacs-7d365a2d72d8e656262205827cc5fdf423c3a41f.tar.gz emacs-7d365a2d72d8e656262205827cc5fdf423c3a41f.zip | |
Fix idna-mapping-table following Unicode 16 changes
The latest version of UTS #46 in Unicode 16 has changed the way it
indicates which codepoints are invalid in domain names, causing
'idna-mapping-table' to contain incorrect information, which then breaks
'textsec-domain-suspicious-p' and our test suite. (Bug#73312)
* admin/unidata/unidata-gen.el (unidata-gen-idna-mapping): Check the
IDNA validity field in "IdnaMappingTable.txt" in addition to checking
the status field, as the latter can now be 'valid' for disallowed
codepoints.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/unidata/unidata-gen.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el index 7be03fe63af..71ea7bddb84 100644 --- a/admin/unidata/unidata-gen.el +++ b/admin/unidata/unidata-gen.el | |||
| @@ -1598,15 +1598,21 @@ same directory.")) | |||
| 1598 | (let ((map (make-char-table nil))) | 1598 | (let ((map (make-char-table nil))) |
| 1599 | (with-temp-buffer | 1599 | (with-temp-buffer |
| 1600 | (unidata-gen--insert-file "IdnaMappingTable.txt") | 1600 | (unidata-gen--insert-file "IdnaMappingTable.txt") |
| 1601 | (while (re-search-forward "^\\([0-9A-F]+\\)\\(?:\\.\\.\\([0-9A-F]+\\)\\)? +; +\\([^ ]+\\) +\\(?:; +\\([ 0-9A-F]+\\)\\)?" | 1601 | (while (re-search-forward "^\\([0-9A-F]+\\)\\(?:\\.\\.\\([0-9A-F]+\\)\\)? +; +\\([^ ]+\\) +\\(?:; +\\([ 0-9A-F]+\\)\\)?\\(?:; \\(NV8\\|XV8\\)\\)?" |
| 1602 | nil t) | 1602 | nil t) |
| 1603 | (let ((start (match-string 1)) | 1603 | (let ((start (match-string 1)) |
| 1604 | (end (match-string 2)) | 1604 | (end (match-string 2)) |
| 1605 | (status (match-string 3)) | 1605 | (status (match-string 3)) |
| 1606 | (mapped (match-string 4))) | 1606 | (mapped (match-string 4)) |
| 1607 | (idna-status (match-string 5))) | ||
| 1607 | ;; Make reading the file slightly faster by using `t' | 1608 | ;; Make reading the file slightly faster by using `t' |
| 1608 | ;; instead of `disallowed' all over the place. | 1609 | ;; instead of `disallowed' all over the place. |
| 1609 | (when (string-match-p "\\`disallowed" status) | 1610 | (when (or (string-match-p "\\`disallowed" status) |
| 1611 | ;; UTS #46 messed us about with "status = valid" for | ||
| 1612 | ;; invalid characters, so we need to check for "NV8" or | ||
| 1613 | ;; "XV8". | ||
| 1614 | (string= idna-status "NV8") | ||
| 1615 | (string= idna-status "XV8")) | ||
| 1610 | (setq status "t")) | 1616 | (setq status "t")) |
| 1611 | (unless (or (equal status "valid") | 1617 | (unless (or (equal status "valid") |
| 1612 | (equal status "deviation")) | 1618 | (equal status "deviation")) |