forgot to stage these test files in commit d70d061
This commit is contained in:
parent
482d23bcac
commit
86112951d6
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
# $OpenBSD: mktestdata.sh,v 1.6 2017/04/30 23:33:48 djm Exp $
|
||||
# $OpenBSD: mktestdata.sh,v 1.7 2018/09/12 01:36:45 djm Exp $
|
||||
|
||||
PW=mekmitasdigoat
|
||||
|
||||
|
@ -128,6 +128,18 @@ ssh-keygen -s rsa_2 -I hugo -n user1,user2 \
|
|||
-Oforce-command=/bin/ls -Ono-port-forwarding -Osource-address=10.0.0.0/8 \
|
||||
-V 19990101:20110101 -z 4 ed25519_1.pub
|
||||
|
||||
# Make a few RSA variant signature too.
|
||||
cp rsa_1 rsa_1_sha1
|
||||
cp rsa_1 rsa_1_sha512
|
||||
cp rsa_1.pub rsa_1_sha1.pub
|
||||
cp rsa_1.pub rsa_1_sha512.pub
|
||||
ssh-keygen -s rsa_2 -I hugo -n user1,user2 -t ssh-rsa \
|
||||
-Oforce-command=/bin/ls -Ono-port-forwarding -Osource-address=10.0.0.0/8 \
|
||||
-V 19990101:20110101 -z 1 rsa_1_sha1.pub
|
||||
ssh-keygen -s rsa_2 -I hugo -n user1,user2 -t rsa-sha2-512 \
|
||||
-Oforce-command=/bin/ls -Ono-port-forwarding -Osource-address=10.0.0.0/8 \
|
||||
-V 19990101:20110101 -z 1 rsa_1_sha512.pub
|
||||
|
||||
ssh-keygen -s ed25519_1 -I julius -n host1,host2 -h \
|
||||
-V 19990101:20110101 -z 5 rsa_1.pub
|
||||
ssh-keygen -s ed25519_1 -I julius -n host1,host2 -h \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: test_file.c,v 1.6 2017/04/30 23:33:48 djm Exp $ */
|
||||
/* $OpenBSD: test_file.c,v 1.7 2018/09/12 01:36:45 djm Exp $ */
|
||||
/*
|
||||
* Regress test for sshkey.h key management API
|
||||
*
|
||||
|
@ -105,6 +105,24 @@ sshkey_file_tests(void)
|
|||
sshkey_free(k2);
|
||||
TEST_DONE();
|
||||
|
||||
TEST_START("load RSA cert with SHA1 signature");
|
||||
ASSERT_INT_EQ(sshkey_load_cert(test_data_file("rsa_1_sha1"), &k2), 0);
|
||||
ASSERT_PTR_NE(k2, NULL);
|
||||
ASSERT_INT_EQ(k2->type, KEY_RSA_CERT);
|
||||
ASSERT_INT_EQ(sshkey_equal_public(k1, k2), 1);
|
||||
ASSERT_STRING_EQ(k2->cert->signature_type, "ssh-rsa");
|
||||
sshkey_free(k2);
|
||||
TEST_DONE();
|
||||
|
||||
TEST_START("load RSA cert with SHA512 signature");
|
||||
ASSERT_INT_EQ(sshkey_load_cert(test_data_file("rsa_1_sha512"), &k2), 0);
|
||||
ASSERT_PTR_NE(k2, NULL);
|
||||
ASSERT_INT_EQ(k2->type, KEY_RSA_CERT);
|
||||
ASSERT_INT_EQ(sshkey_equal_public(k1, k2), 1);
|
||||
ASSERT_STRING_EQ(k2->cert->signature_type, "rsa-sha2-512");
|
||||
sshkey_free(k2);
|
||||
TEST_DONE();
|
||||
|
||||
TEST_START("load RSA cert");
|
||||
ASSERT_INT_EQ(sshkey_load_cert(test_data_file("rsa_1"), &k2), 0);
|
||||
ASSERT_PTR_NE(k2, NULL);
|
||||
|
|
Loading…
Reference in New Issue