From 5733f4999c3394273c4e3c375471d2a0ff77d5d3 Mon Sep 17 00:00:00 2001 From: djm Date: Mon, 22 Dec 2014 02:15:52 +0000 Subject: [PATCH] adjust for new SHA256 key fingerprints and slightly-different MD5 hex fingerprint format --- regress/usr.bin/ssh/Makefile | 10 ++++-- regress/usr.bin/ssh/t11.ok | 1 + regress/usr.bin/ssh/t4.ok | 2 +- .../usr.bin/ssh/unittests/sshkey/test_file.c | 31 ++++++++++--------- .../unittests/sshkey/testdata/dsa_1-cert.fp | 2 +- .../ssh/unittests/sshkey/testdata/dsa_1.fp | 2 +- .../ssh/unittests/sshkey/testdata/dsa_2.fp | 2 +- .../unittests/sshkey/testdata/ecdsa_1-cert.fp | 2 +- .../ssh/unittests/sshkey/testdata/ecdsa_1.fp | 2 +- .../ssh/unittests/sshkey/testdata/ecdsa_2.fp | 2 +- .../sshkey/testdata/ed25519_1-cert.fp | 2 +- .../unittests/sshkey/testdata/ed25519_1.fp | 2 +- .../unittests/sshkey/testdata/ed25519_2.fp | 2 +- .../ssh/unittests/sshkey/testdata/rsa1_1.fp | 2 +- .../ssh/unittests/sshkey/testdata/rsa1_2.fp | 2 +- .../unittests/sshkey/testdata/rsa_1-cert.fp | 2 +- .../ssh/unittests/sshkey/testdata/rsa_1.fp | 2 +- .../ssh/unittests/sshkey/testdata/rsa_2.fp | 2 +- 18 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 regress/usr.bin/ssh/t11.ok diff --git a/regress/usr.bin/ssh/Makefile b/regress/usr.bin/ssh/Makefile index 58faf64ecac..b1790b38610 100644 --- a/regress/usr.bin/ssh/Makefile +++ b/regress/usr.bin/ssh/Makefile @@ -1,7 +1,7 @@ -# $OpenBSD: Makefile,v 1.70 2014/06/24 01:14:17 djm Exp $ +# $OpenBSD: Makefile,v 1.71 2014/12/22 02:15:52 djm Exp $ REGRESS_FAIL_EARLY= yes -REGRESS_TARGETS= unit t1 t2 t3 t4 t5 t6 t7 t8 t9 +REGRESS_TARGETS= unit t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 CLEANFILES+= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ t8.out t8.out.pub t9.out t9.out.pub @@ -108,7 +108,7 @@ t3: diff - ${.CURDIR}/rsa_openssh.pub t4: - ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\ + ssh-keygen -E md5 -lf ${.CURDIR}/rsa_openssh.pub |\ awk '{print $$2}' | diff - ${.CURDIR}/t4.ok t5: @@ -149,6 +149,10 @@ t10: t10.out ssh-keygen -lf t10.out > /dev/null ssh-keygen -Bf t10.out > /dev/null +t11: + ssh-keygen -E sha256 -lf ${.CURDIR}/rsa_openssh.pub |\ + awk '{print $$2}' | diff - ${.CURDIR}/t11.ok + modpipe: modpipe.c t-integrity: modpipe diff --git a/regress/usr.bin/ssh/t11.ok b/regress/usr.bin/ssh/t11.ok new file mode 100644 index 00000000000..1925bb470fc --- /dev/null +++ b/regress/usr.bin/ssh/t11.ok @@ -0,0 +1 @@ +SHA256:4w1rnrek3klTJOTVhwuCIFd5k+pq9Bfo5KTxxb8BqbY diff --git a/regress/usr.bin/ssh/t4.ok b/regress/usr.bin/ssh/t4.ok index 8c4942bf177..4631ea8c709 100644 --- a/regress/usr.bin/ssh/t4.ok +++ b/regress/usr.bin/ssh/t4.ok @@ -1 +1 @@ -3b:dd:44:e9:49:18:84:95:f1:e7:33:6b:9d:93:b1:36 +MD5:3b:dd:44:e9:49:18:84:95:f1:e7:33:6b:9d:93:b1:36 diff --git a/regress/usr.bin/ssh/unittests/sshkey/test_file.c b/regress/usr.bin/ssh/unittests/sshkey/test_file.c index 19056b52ae8..a608fd1c241 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/test_file.c +++ b/regress/usr.bin/ssh/unittests/sshkey/test_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test_file.c,v 1.1 2014/06/24 01:14:18 djm Exp $ */ +/* $OpenBSD: test_file.c,v 1.2 2014/12/22 02:15:52 djm Exp $ */ /* * Regress test for sshkey.h key management API * @@ -27,6 +27,7 @@ #include "authfile.h" #include "sshkey.h" #include "sshbuf.h" +#include "digest.h" #include "common.h" @@ -75,7 +76,7 @@ sshkey_file_tests(void) TEST_START("RSA1 key hex fingerprint"); buf = load_text_file("rsa1_1.fp"); - cp = sshkey_fingerprint(k1, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k1, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -84,7 +85,7 @@ sshkey_file_tests(void) TEST_START("RSA1 key bubblebabble fingerprint"); buf = load_text_file("rsa1_1.fp.bb"); - cp = sshkey_fingerprint(k1, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE); + cp = sshkey_fingerprint(k1, SSH_DIGEST_SHA1, SSH_FP_BUBBLEBABBLE); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -158,7 +159,7 @@ sshkey_file_tests(void) TEST_START("RSA key hex fingerprint"); buf = load_text_file("rsa_1.fp"); - cp = sshkey_fingerprint(k1, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k1, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -167,7 +168,7 @@ sshkey_file_tests(void) TEST_START("RSA cert hex fingerprint"); buf = load_text_file("rsa_1-cert.fp"); - cp = sshkey_fingerprint(k2, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k2, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -177,7 +178,7 @@ sshkey_file_tests(void) TEST_START("RSA key bubblebabble fingerprint"); buf = load_text_file("rsa_1.fp.bb"); - cp = sshkey_fingerprint(k1, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE); + cp = sshkey_fingerprint(k1, SSH_DIGEST_SHA1, SSH_FP_BUBBLEBABBLE); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -251,7 +252,7 @@ sshkey_file_tests(void) TEST_START("DSA key hex fingerprint"); buf = load_text_file("dsa_1.fp"); - cp = sshkey_fingerprint(k1, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k1, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -260,7 +261,7 @@ sshkey_file_tests(void) TEST_START("DSA cert hex fingerprint"); buf = load_text_file("dsa_1-cert.fp"); - cp = sshkey_fingerprint(k2, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k2, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -270,7 +271,7 @@ sshkey_file_tests(void) TEST_START("DSA key bubblebabble fingerprint"); buf = load_text_file("dsa_1.fp.bb"); - cp = sshkey_fingerprint(k1, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE); + cp = sshkey_fingerprint(k1, SSH_DIGEST_SHA1, SSH_FP_BUBBLEBABBLE); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -350,7 +351,7 @@ sshkey_file_tests(void) TEST_START("ECDSA key hex fingerprint"); buf = load_text_file("ecdsa_1.fp"); - cp = sshkey_fingerprint(k1, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k1, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -359,7 +360,7 @@ sshkey_file_tests(void) TEST_START("ECDSA cert hex fingerprint"); buf = load_text_file("ecdsa_1-cert.fp"); - cp = sshkey_fingerprint(k2, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k2, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -369,7 +370,7 @@ sshkey_file_tests(void) TEST_START("ECDSA key bubblebabble fingerprint"); buf = load_text_file("ecdsa_1.fp.bb"); - cp = sshkey_fingerprint(k1, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE); + cp = sshkey_fingerprint(k1, SSH_DIGEST_SHA1, SSH_FP_BUBBLEBABBLE); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -416,7 +417,7 @@ sshkey_file_tests(void) TEST_START("Ed25519 key hex fingerprint"); buf = load_text_file("ed25519_1.fp"); - cp = sshkey_fingerprint(k1, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k1, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -425,7 +426,7 @@ sshkey_file_tests(void) TEST_START("Ed25519 cert hex fingerprint"); buf = load_text_file("ed25519_1-cert.fp"); - cp = sshkey_fingerprint(k2, SSH_FP_MD5, SSH_FP_HEX); + cp = sshkey_fingerprint(k2, SSH_DIGEST_MD5, SSH_FP_HEX); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); @@ -435,7 +436,7 @@ sshkey_file_tests(void) TEST_START("Ed25519 key bubblebabble fingerprint"); buf = load_text_file("ed25519_1.fp.bb"); - cp = sshkey_fingerprint(k1, SSH_FP_SHA1, SSH_FP_BUBBLEBABBLE); + cp = sshkey_fingerprint(k1, SSH_DIGEST_SHA1, SSH_FP_BUBBLEBABBLE); ASSERT_PTR_NE(cp, NULL); ASSERT_STRING_EQ(cp, (const char *)sshbuf_ptr(buf)); sshbuf_free(buf); diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1-cert.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1-cert.fp index 56ee1f89b9e..b26145b24d5 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1-cert.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1-cert.fp @@ -1 +1 @@ -5a:4a:41:8c:4e:fa:4c:52:19:f9:39:49:31:fb:fd:74 +MD5:5a:4a:41:8c:4e:fa:4c:52:19:f9:39:49:31:fb:fd:74 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1.fp index 56ee1f89b9e..b26145b24d5 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_1.fp @@ -1 +1 @@ -5a:4a:41:8c:4e:fa:4c:52:19:f9:39:49:31:fb:fd:74 +MD5:5a:4a:41:8c:4e:fa:4c:52:19:f9:39:49:31:fb:fd:74 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_2.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_2.fp index ba9de82a8a8..8226574039d 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_2.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/dsa_2.fp @@ -1 +1 @@ -72:5f:50:6b:e5:64:c5:62:21:92:3f:8b:10:9b:9f:1a +MD5:72:5f:50:6b:e5:64:c5:62:21:92:3f:8b:10:9b:9f:1a diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1-cert.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1-cert.fp index a56dbc8d011..c3d747affb6 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1-cert.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1-cert.fp @@ -1 +1 @@ -f7:be:4c:02:65:ed:4c:11:af:ab:a8:dd:0a:92:e7:44 +MD5:f7:be:4c:02:65:ed:4c:11:af:ab:a8:dd:0a:92:e7:44 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1.fp index a56dbc8d011..c3d747affb6 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_1.fp @@ -1 +1 @@ -f7:be:4c:02:65:ed:4c:11:af:ab:a8:dd:0a:92:e7:44 +MD5:f7:be:4c:02:65:ed:4c:11:af:ab:a8:dd:0a:92:e7:44 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_2.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_2.fp index eb4bbdf0304..fe7526b9290 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_2.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/ecdsa_2.fp @@ -1 +1 @@ -51:bd:ff:2b:6d:26:9b:90:f9:e1:4a:ca:a0:29:8e:70 +MD5:51:bd:ff:2b:6d:26:9b:90:f9:e1:4a:ca:a0:29:8e:70 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1-cert.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1-cert.fp index e6d23d0b84c..fbde87af041 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1-cert.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1-cert.fp @@ -1 +1 @@ -19:08:8e:7e:4d:e5:de:86:2a:09:47:65:eb:0a:51:2f +MD5:19:08:8e:7e:4d:e5:de:86:2a:09:47:65:eb:0a:51:2f diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1.fp index e6d23d0b84c..fbde87af041 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_1.fp @@ -1 +1 @@ -19:08:8e:7e:4d:e5:de:86:2a:09:47:65:eb:0a:51:2f +MD5:19:08:8e:7e:4d:e5:de:86:2a:09:47:65:eb:0a:51:2f diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_2.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_2.fp index 02c684f36af..ec1cdbb94d9 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_2.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/ed25519_2.fp @@ -1 +1 @@ -5c:c9:ae:a3:0c:aa:28:29:b8:fc:7c:64:ba:6e:e9:c9 +MD5:5c:c9:ae:a3:0c:aa:28:29:b8:fc:7c:64:ba:6e:e9:c9 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_1.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_1.fp index 782ece0dbec..2e1068c649e 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_1.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_1.fp @@ -1 +1 @@ -a8:82:9b:98:c5:e6:19:d6:83:39:9f:4d:3a:8f:7c:80 +MD5:a8:82:9b:98:c5:e6:19:d6:83:39:9f:4d:3a:8f:7c:80 diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_2.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_2.fp index c3325371d56..cd0039306f8 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_2.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa1_2.fp @@ -1 +1 @@ -c0:83:1c:97:5f:32:77:7e:e4:e3:e9:29:b9:eb:76:9c +MD5:c0:83:1c:97:5f:32:77:7e:e4:e3:e9:29:b9:eb:76:9c diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1-cert.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1-cert.fp index bf9c2e3626f..1cf780dd952 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1-cert.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1-cert.fp @@ -1 +1 @@ -be:27:4c:16:27:f5:04:03:62:a8:b7:91:df:a5:b1:3b +MD5:be:27:4c:16:27:f5:04:03:62:a8:b7:91:df:a5:b1:3b diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1.fp index bf9c2e3626f..1cf780dd952 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_1.fp @@ -1 +1 @@ -be:27:4c:16:27:f5:04:03:62:a8:b7:91:df:a5:b1:3b +MD5:be:27:4c:16:27:f5:04:03:62:a8:b7:91:df:a5:b1:3b diff --git a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_2.fp b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_2.fp index 53939f413db..8d43676105d 100644 --- a/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_2.fp +++ b/regress/usr.bin/ssh/unittests/sshkey/testdata/rsa_2.fp @@ -1 +1 @@ -fb:8f:7b:26:3d:42:40:ef:ed:f1:ed:ee:66:9e:ba:b0 +MD5:fb:8f:7b:26:3d:42:40:ef:ed:f1:ed:ee:66:9e:ba:b0 -- 2.20.1