>From afea12fb0cd4fc62a8dcf3e280de9be871f5fb5b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sun, 28 Feb 2021 01:17:05 -0800 Subject: [PATCH] Fix Bootstring skew parameter in puny.el * lisp/net/puny.el: change puny-skew to match value given in RFC3492. * test/lisp/net/puny-tests.el (puny-test-encode-domain) (puny-test-decode-domain): add regression case for popular domain. --- lisp/net/puny.el | 2 +- test/lisp/net/puny-tests.el | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/net/puny.el b/lisp/net/puny.el index 6b3663a5fb2..1cdefc08f02 100644 --- a/lisp/net/puny.el +++ b/lisp/net/puny.el @@ -75,7 +75,7 @@ puny-base (defconst puny-damp 700) (defconst puny-tmin 1) (defconst puny-tmax 26) -(defconst puny-skew 28) +(defconst puny-skew 38) ;; 0-25 a-z ;; 26-36 0-9 diff --git a/test/lisp/net/puny-tests.el b/test/lisp/net/puny-tests.el index b37168f5ca7..28c0d49cbee 100644 --- a/test/lisp/net/puny-tests.el +++ b/test/lisp/net/puny-tests.el @@ -39,10 +39,12 @@ puny-test-decode2 (should (string= (puny-decode-string "xn--9dbdkw") "חנוך"))) (ert-deftest puny-test-encode-domain () - (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se"))) + (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se")) + (should (string= (puny-encode-domain "яндекс.рф") "xn--d1acpjx3f.xn--p1ai"))) (ert-deftest puny-test-decode-domain () - (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se"))) + (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se")) + (should (string= (puny-decode-domain "xn--d1acpjx3f.xn--p1ai") "яндекс.рф"))) (ert-deftest puny-highly-restrictive-domain-p () (should (puny-highly-restrictive-domain-p "foo.bar.org")) -- 2.29.2