1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 10:50:49 -08:00
Commit graph

28 commits

Author SHA1 Message Date
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Stefan Kangas
d73b86a90a Fix typo in textsec-restriction-level
* lisp/international/textsec.el (textsec-restriction-level):
* test/lisp/international/textsec-tests.el (test-restriction-level):
Fix typo in symbol name `moderately-restrictive'.
2022-10-26 23:02:30 +02:00
Mattias Engdegård
26db1ca80e Recognise hybrid IPv6/IPv4 addresses in textsec (bug#54624)
* lisp/international/textsec.el (textsec--ipvx-address-p):
  Recognise hybrid addresses like "::ffff:129.55.2.201".
  Combine to a single regexp and translate to rx.
  Remove some regexp ambiguity (relint complaint).
* test/lisp/international/textsec-tests.el (test-suspiction-domain):
  Add test cases.
2022-04-11 16:29:24 +02:00
Lars Ingebrigtsen
fbf2ed9a64 ipv6 addresses aren't suspicious
* lisp/international/textsec.el (textsec--ipvx-address-p): New
function.
(textsec-domain-suspicious-p): Use it to say that ipv6 addresses
aren't suspicious (bug#54624).
2022-03-29 17:12:01 +02:00
Lars Ingebrigtsen
00a8e365b9 Adjust test to adjusted code 2022-02-03 01:25:42 +01:00
Eli Zaretskii
682b6df6bf Improve detection of suspicious uses of bidi controls
* lisp/international/textsec.el
(textsec-bidi-controls-suspicious-p): New function.
(textsec-name-suspicious-p): Use it.

* test/lisp/international/textsec-tests.el (test-suspicious-name):
Enable the test that was previously failing with
'bidi-find-overridden-directionality'.
2022-01-22 11:58:05 +02:00
Lars Ingebrigtsen
cce813a4e7 Make textsec-link-suspicious-p less mistrustful
* lisp/international/textsec.el (textsec-link-suspicious-p): Scale
back the suspicion -- only warn about texts that contain a full
explicit link.
2022-01-20 18:12:44 +01:00
Lars Ingebrigtsen
b1488a6582 Re-enable some textsec-tests after recent bidi.c fix 2022-01-20 11:06:58 +01:00
Lars Ingebrigtsen
ea0060abfb Add test for bug#51733 2022-01-20 10:10:08 +01:00
Lars Ingebrigtsen
4768657b31 Allow suspicious names with some forms of bidi controls
* lisp/international/textsec.el (textsec-name-suspicious-p): Allow
names with bidi-find-overridden-directionality.
2022-01-20 09:52:08 +01:00
Lars Ingebrigtsen
7cfc0bd6a9 Check link text domain suspiciousness
* lisp/international/textsec.el (textsec-link-suspicious-p): Check
whether the domain in the link text is suspicious.
2022-01-20 08:01:20 +01:00
Lars Ingebrigtsen
f9f12086fb Expand textsec-link-suspicious-p checking
* lisp/international/textsec.el (textsec-link-suspicious-p): Check
the text more thoroughly for link-like things.
2022-01-20 07:57:13 +01:00
Lars Ingebrigtsen
7e7974154b Improve textsec-domain-suspicious-p message
* lisp/international/textsec.el (textsec-domain-suspicious-p):
Ensure that we're not confusing the user if there's a directional
override in the string we're checking.
2022-01-20 07:45:33 +01:00
Lars Ingebrigtsen
50ddfb2428 Make textsec-mixed-numbers-p actually work
* lisp/international/textsec.el (textsec-mixed-numbers-p): Fix the
test.
2022-01-19 18:50:40 +01:00
Lars Ingebrigtsen
e58b4b24cf Add text for suspicious links
* lisp/international/textsec-check.el (textsec-check): Note `link'.
(textsec-propertize): Fix typo.

* lisp/international/textsec.el (textsec-link-suspicious-p): New
function.

* lisp/net/shr.el (shr-tag-a): Check for sus links.
2022-01-19 17:50:21 +01:00
Lars Ingebrigtsen
1bfc086391 Make shr mark links with suspicious URLs
* lisp/international/textsec-check.el (textsec-propertize): New
function.
(textsec-check): Only check, don't alter STRING.

* lisp/international/textsec.el (textsec-url-suspicious-p): New
function.

* lisp/net/shr.el (shr-tag-a): Mark suspicious links.
2022-01-19 16:37:05 +01:00
Lars Ingebrigtsen
00a6946283 Add new file textsec-check.el
* lisp/international/textsec-check.el: New file.
* lisp/international/textsec.el
(textsec-email-address-header-suspicious-p): Rename.
2022-01-19 16:22:16 +01:00
Lars Ingebrigtsen
598038643f Mark whole-script confusables as suspicious domains
* lisp/international/textsec.el (textsec-domain-suspicious-p):
Consider domain names that are whole-script confusables with ASCII
to be suspicious.  (I think this is what the Unicode standard is
recommending, but I'm not 100% sure.)
2022-01-19 15:52:20 +01:00
Lars Ingebrigtsen
124c4ad1e5 Split textsec-email-address-suspicious-p into two functions
* lisp/international/textsec.el
(textsec-email-address-suspicious-p): Made into its own function.
(textsec-email-suspicious-p): Use it and adjust doc strings.
2022-01-19 15:21:50 +01:00
Lars Ingebrigtsen
b4336b2832 Make textsec-suspicious-nonspacing-p work on marks
* lisp/international/textsec.el (textsec-suspicious-nonspacing-p):
We're only interested in nonspacing marks, not control characters
in this test.
2022-01-19 14:42:39 +01:00
Lars Ingebrigtsen
ce63f91025 Add textsec functions for verifying email addresses
* lisp/international/characters.el (bidi-control-characters):
Rename from glyphless--bidi-control-characters for use in textsec,
and add LRM/RLM/ALM.
(update-glyphless-char-display): Adjust the code.

* lisp/international/textsec.el (textsec-local-address-suspicious-p)
(textsec-name-suspicious-p, textsec-suspicious-nonspacing-p)
(textsec-email-suspicious-p): New functions.
2022-01-18 13:20:04 +01:00
Lars Ingebrigtsen
9f25c41ad4 Add textsec-domain-suspicious-p
* .gitignore: Ignore idna-mapping.el.

* admin/notes/unicode: Note idna-mapping file.
* admin/unidata/IdnaMappingTable.txt: New file.

* admin/unidata/Makefile.in (all): Generate idna-mapping.el.

* admin/unidata/unidata-gen.el (unidata-gen-idna-mapping): Generate.

* lisp/international/textsec.el (textsec-domain-suspicious-p): New
function.
2022-01-18 11:53:09 +01:00
Lars Ingebrigtsen
4eebf528fc Add textsec predicates for different types of confusability
* lisp/international/textsec.el (textsec-resolved-script-set)
(textsec-single-script-confusable-p)
(textsec-mixed-script-confusable-p)
(textsec-whole-script-confusable-p): New functions.
2022-01-18 10:24:32 +01:00
Lars Ingebrigtsen
19fefea1ca Add textsec support for confusable characters
* admin/notes/unicode: Note the confusables.txt file.
* admin/unidata/Makefile.in (${unidir}/uni-confusable.el):
Generate the confusable file.

* admin/unidata/README (https): Add confusables.txt.

* admin/unidata/confusables.txt: New file.

* admin/unidata/unidata-gen.el (unidata-gen-confusable): Parse the
confusables.txt file.

* lisp/international/textsec.el (textsec-ascii-confusable-p)
(textsec-unconfuse-string): New functions.
2022-01-18 09:57:54 +01:00
Lars Ingebrigtsen
1c7307673b Add new function textsec-mixed-numbers-p
* lisp/international/textsec.el (textsec-mixed-numbers-p): New
function.
2022-01-17 17:32:58 +01:00
Lars Ingebrigtsen
a1ffee1e82 Add textsec-restriction-level function
* lisp/international/textsec.el (textsec-restriction-level): New
function.
2022-01-17 16:24:17 +01:00
Lars Ingebrigtsen
e2c8091113 Add support for functions that deal with Unicode scripts
* admin/unidata/Makefile.in (${unidir}/uni-scripts.el): Build
uni-scripts.el.

* admin/unidata/Scripts.txt:
* admin/unidata/ScriptExtensions.txt:
* admin/unidata/PropertyValueAliases.txt: New files from Unicode.

* admin/unidata/README: Update.

* admin/unidata/unidata-gen.el (unidata-gen-charprop): Allow
writing other data, too.
(unidata-gen-scripts, unidata-gen--read-script-aliases)
(unidata-gen--insert-file): New functions to parse the Script* files.

* lisp/international/textsec.el: Implement some functions that
work on scripts.
2022-01-17 15:47:50 +01:00