summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-11 17:36:26 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-11 17:36:26 +0200
commit2c45d3cae0f60efd7281fe86e3a76cebab20a159 (patch)
treeb18f2596e9912e20d14283a0200729dd7c4cdc54
parent949bc336a066cd80a0c7e0c2a72e0cb10636692b (diff)
downloademacs-2c45d3cae0f60efd7281fe86e3a76cebab20a159.tar.gz
Make more IPV6 domains non-suspicious in textsec
* lisp/international/textsec.el (textsec--ipvx-address-p): Make more IPV6 domains non-suspicious.
-rw-r--r--lisp/international/textsec.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/international/textsec.el b/lisp/international/textsec.el
index 3e787909384..82eba1b5d51 100644
--- a/lisp/international/textsec.el
+++ b/lisp/international/textsec.el
@@ -236,15 +236,16 @@ The scripts are as defined by the Unicode Standard Annex 24 (UAX#24)."
;; This is a very relaxed pattern for IPv4 or IPv6 addresses. The
;; assumption is that any malformed address accepted by this rule
;; will be rejected by the actual address parser eventually.
- (rx-let ((ipv4 (** 1 4
- (** 1 3 (in "0-9"))
- (? ".")))
- (ipv6 (: (** 1 7
- (** 0 4 (in "0-9a-f"))
- ":")
- (** 0 4 (in "0-9a-f"))
- (? ":" ipv4))))
- (string-match-p (rx bos (or ipv4 ipv6 (: "[" ipv6 "]")) eos) domain)))
+ (let ((case-fold-search t))
+ (rx-let ((ipv4 (** 1 4
+ (** 1 3 (in "0-9"))
+ (? ".")))
+ (ipv6 (: (** 1 7
+ (** 0 4 (in "0-9a-f"))
+ ":")
+ (** 0 4 (in "0-9a-f"))
+ (? ":" ipv4))))
+ (string-match-p (rx bos (or ipv4 ipv6 (: "[" ipv6 "]")) eos) domain))))
(defun textsec-domain-suspicious-p (domain)
"Say whether DOMAIN's name looks suspicious.