summaryrefslogtreecommitdiff
path: root/regress/unittests/sshkey/test_sshkey.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-07-07 14:53:30 +0000
committerDamien Miller <djm@mindrot.org>2015-07-15 16:04:26 +1000
commit7c8c174c69f681d4910fa41c37646763692b28e2 (patch)
tree03cd42182b3576a881607794bf92734521d10cd8 /regress/unittests/sshkey/test_sshkey.c
parent6a977a4b68747ade189e43d302f33403fd4a47ac (diff)
upstream commit
adapt tests to new minimum RSA size and default FP format Upstream-Regress-ID: a4b30afd174ce82b96df14eb49fb0b81398ffd0e
Diffstat (limited to 'regress/unittests/sshkey/test_sshkey.c')
-rw-r--r--regress/unittests/sshkey/test_sshkey.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 9e780701..f0ce38a4 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/unittests/sshkey/test_sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_sshkey.c,v 1.5 2015/07/03 04:39:23 djm Exp $ */
+/* $OpenBSD: test_sshkey.c,v 1.6 2015/07/07 14:53:30 markus Exp $ */
/*
* Regress test for sshkey.h key management API
*
@@ -288,13 +288,15 @@ sshkey_tests(void)
#endif
TEST_START("generate KEY_RSA");
- ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 768, &kr), 0);
+ ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 768, &kr),
+ SSH_ERR_INVALID_ARGUMENT);
+ ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &kr), 0);
ASSERT_PTR_NE(kr, NULL);
ASSERT_PTR_NE(kr->rsa, NULL);
ASSERT_PTR_NE(kr->rsa->n, NULL);
ASSERT_PTR_NE(kr->rsa->e, NULL);
ASSERT_PTR_NE(kr->rsa->p, NULL);
- ASSERT_INT_EQ(BN_num_bits(kr->rsa->n), 768);
+ ASSERT_INT_EQ(BN_num_bits(kr->rsa->n), 1024);
TEST_DONE();
TEST_START("generate KEY_DSA");
@@ -397,7 +399,7 @@ sshkey_tests(void)
TEST_DONE();
TEST_START("equal different keys");
- ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 768, &k1), 0);
+ ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &k1), 0);
ASSERT_INT_EQ(sshkey_equal(kr, k1), 0);
sshkey_free(k1);
ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 1024, &k1), 0);