[Git][reproducible-builds/diffoscope][master] 3 commits: Revert "Move away from using DSA OpenSSH keys in tests as support has been...

Mattia Rizzolo (@mattia) gitlab at salsa.debian.org
Mon Jul 29 06:58:47 UTC 2024



Mattia Rizzolo pushed to branch master at Reproducible Builds / diffoscope


Commits:
f3f72b9f by Mattia Rizzolo at 2024-07-29T15:43:06+09:00
Revert "Move away from using DSA OpenSSH keys in tests as support has been removed in OpenSSH 9.8p1. (Closes: #382)"

Re-instate the previous test file - will disable via code later

This reverts commit 0743d63f85f298131e78045ec6d73acdc50b97eb.

- - - - -
652b5793 by Mattia Rizzolo at 2024-07-29T15:53:10+09:00
test: add OpenSSH key test with a ed25519 key

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -
7917b746 by Mattia Rizzolo at 2024-07-29T15:57:59+09:00
test: skip the OpenSSH test with DSA key if openssh is >> 9.7

newer versions are very likely to not be compiled with DSA support

See https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/382
and also commit 0743d63f85f298131e78045ec6d73acdc50b97eb

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


6 changed files:

- tests/comparators/test_openssh_pub_key.py
- tests/data/openssh_pub_key_expected_diff → tests/data/openssh_pub_key_expected_diff_12
- + tests/data/openssh_pub_key_expected_diff_23
- tests/data/test_openssh_pub_key1.pub
- + tests/data/test_openssh_pub_key3.pub
- tests/utils/versions.py


Changes:

=====================================
tests/comparators/test_openssh_pub_key.py
=====================================
@@ -26,13 +26,19 @@ from diffoscope.comparators.openssh import PublicKeyFile
 from diffoscope.comparators.missing_file import MissingFile
 
 from ..utils.data import assert_diff, load_fixture
-from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
+from ..utils.tools import (
+    skip_unless_tools_exist,
+    skip_unless_tool_is_at_least,
+    skip_unless_tool_is_at_most,
+)
 
 
-# Generated by: ssh-keygen -t rsa -C "Test1"
+# Generated by: ssh-keygen -t dsa -C "Test1"
 opensshpubkey1 = load_fixture("test_openssh_pub_key1.pub")
 # Generated by: ssh-keygen -t rsa -b 4096 -C "Test2"
 opensshpubkey2 = load_fixture("test_openssh_pub_key2.pub")
+# Generated by: ssh-keygen -t ed25519 -C Test3
+opensshpubkey3 = load_fixture("test_openssh_pub_key3.pub")
 
 
 def openssh_version():
@@ -40,29 +46,48 @@ def openssh_version():
     return re.match(r"OpenSSH_([a-zA-Z0-9._+-]+)", out.decode()).group(1)
 
 
-def test_identification(opensshpubkey1):
+def test_identification_dsa(opensshpubkey1):
     assert isinstance(opensshpubkey1, PublicKeyFile)
 
 
+def test_identification_rsa(opensshpubkey1):
+    assert isinstance(opensshpubkey1, PublicKeyFile)
+
+
+def test_identification_ed25519(opensshpubkey3):
+    assert isinstance(opensshpubkey3, PublicKeyFile)
+
+
 def test_no_differences(opensshpubkey1):
     difference = opensshpubkey1.compare(opensshpubkey1)
     assert difference is None
 
 
 @pytest.fixture
-def differences(opensshpubkey1, opensshpubkey2):
+def differences12(opensshpubkey1, opensshpubkey2):
     return opensshpubkey1.compare(opensshpubkey2).details
 
 
+ at pytest.fixture
+def differences23(opensshpubkey2, opensshpubkey3):
+    return opensshpubkey2.compare(opensshpubkey3).details
+
+
+ at skip_unless_tool_is_at_least("ssh-keygen", openssh_version, "6.9")
+ at skip_unless_tool_is_at_most("ssh-keygen", openssh_version, "9.7p1")
+def test_diff12(differences12):
+    assert_diff(differences12[0], "openssh_pub_key_expected_diff_12")
+
+
 @skip_unless_tool_is_at_least("ssh-keygen", openssh_version, "6.9")
-def test_diff(differences):
-    assert_diff(differences[0], "openssh_pub_key_expected_diff")
+def test_diff23(differences23):
+    assert_diff(differences23[0], "openssh_pub_key_expected_diff_23")
 
 
 @skip_unless_tools_exist("ssh-keygen")
-def test_compare_non_existing(monkeypatch, opensshpubkey1):
+def test_compare_non_existing(monkeypatch, opensshpubkey2):
     monkeypatch.setattr(Config(), "new_file", True)
-    difference = opensshpubkey1.compare(
+    difference = opensshpubkey2.compare(
         MissingFile("/nonexisting", opensshpubkey1)
     )
     assert difference.source2 == "/nonexisting"


=====================================
tests/data/openssh_pub_key_expected_diff → tests/data/openssh_pub_key_expected_diff_12
=====================================
@@ -1,3 +1,3 @@
 @@ -1 +1 @@
--3072 SHA256:Rz00jt5jJMTTyRqlVyvALNvUjPgHYIgogQObBrI3opU Test1 (RSA)
+-1024 SHA256:v/O+0ETvi2H5TGRXky1RhQ1/WFwLlPpxch5E2Mrj6FM Test1 (DSA)
 +4096 SHA256:9dH1CMkA6DSfPWU7vNwdPKS5/ppN4LMdvHTP60l7aSA Test2 (RSA)


=====================================
tests/data/openssh_pub_key_expected_diff_23
=====================================
@@ -0,0 +1,3 @@
+@@ -1 +1 @@
+-4096 SHA256:9dH1CMkA6DSfPWU7vNwdPKS5/ppN4LMdvHTP60l7aSA Test2 (RSA)
++256 SHA256:8ST9pb6y/NgI8ZYvBhDhJedL9t0M19eft08gRvr6A8c Test3 (ED25519)


=====================================
tests/data/test_openssh_pub_key1.pub
=====================================
@@ -1 +1 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDUD8xnTzadpJ38IVPXyRbOFWlIPSDABvD0Pf9HBQQNBxH/eK9CSZiHRKC8XS8rLDMkliWnQ1ShLU4OHkaro985zVo9bXauPJcICNDLNSACgWM4HCJdhPEWkwZFwGwVnPYgem/YzXlrYviVzRbUSxIiiuE0yiehtnsheCK2Qk9QKhGRCrYp2AAHIx9eGGHJBVkblmx9lIbTnyRDNyAmU1+k4+7dF2RlJCXo6BjZMKGz7VdLoU/n7/esGWzOQlnZdptl/my23FTw8USvxRZsvzviUV59Qp7SLSziT+bp80NpGpL8uWDMMQ/Rinw2e3EXlZzta2KAqalus5ndtSMyAdQhuGrWSqOpHw/V+KzjbP20I/6i7Zj4kM05mxeJ9xRvxNfhblFXQR5r8MRDhOoxi37RHQ/+A3TbYqHXXxAgVeJ/2zZh/cCqdynqz8J8DdUj4WH3jH7IqhBeOJR80dTbM+sZDj9V0H3odfdbS5gKZbMiAJYYs1xQDYiHIejy5sxq7+s= Test1
+ssh-dss AAAAB3NzaC1kc3MAAACBAIa8YajID9g38jwQm8sNBGoGkkwIOv6sQ8k+Bcq8oPXPy1FRXWcra6Kd3iKqApIzLuZUvoYO/f3G2K4lue5yrv72rgwANWmyL4dHVXgcsjwvWwjOl6o4xWTPFspkdNcAAMcZfzG0+w1AOkQxhwMsnK380m3J9a3VOWugUiU4fV1jAAAAFQDzkrIZuJoxlxes564ltb2Vn3hnpQAAAIBHr6uzpiSeSkWLuItB00hHx1RHtBns0zaheNFTTUMGftxtfBU2eBLqObcTlqHJZ3UUY3/YAvD6Ux/uLSgUzEe7JaqvHcgML3K5V4HWIwE0ARRIwzrfU4cAErJObmZZ/OXbXNNRmW2IJgQJI52x4gVuSt0EEuctzASOOvyPA8IekAAAAIA7xe4o0o/ZwUqfWKR9K4QrbPPa6/D4ruFVhMcRJEE/A1LMY1Xo4nVSRU5bxzvMmJPBZvsbR5NEE3CgESqYxp5IPzK8LLyxcf8YxhdHFDYqFL1TbavwaDqtj6/9a/e7+bd8mMYe7zXJUdKWa/Uf+Xm6WRt3HgdLiCEsS2OlpvS2KA== Test1


=====================================
tests/data/test_openssh_pub_key3.pub
=====================================
@@ -0,0 +1 @@
+ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFWd/pU/agbjC08engoJraAd23N/EiWLZpXiuISQv5JM Test3


=====================================
tests/utils/versions.py
=====================================
@@ -17,7 +17,6 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
-import itertools
 import functools
 import string
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/f8a1e1428dbd95b29e236163a2f9e57aed8f5b32...7917b746581a43741da5331a3873840a99696b3b

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/f8a1e1428dbd95b29e236163a2f9e57aed8f5b32...7917b746581a43741da5331a3873840a99696b3b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240729/6d9c109e/attachment.htm>


More information about the rb-commits mailing list