summaryrefslogtreecommitdiff
path: root/regress/unittests/sshkey/test_sshkey.c
diff options
context:
space:
mode:
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 9e780701a..f0ce38a4a 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/unittests/sshkey/test_sshkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: test_sshkey.c,v 1.5 2015/07/03 04:39:23 djm Exp $ */ 1/* $OpenBSD: test_sshkey.c,v 1.6 2015/07/07 14:53:30 markus Exp $ */
2/* 2/*
3 * Regress test for sshkey.h key management API 3 * Regress test for sshkey.h key management API
4 * 4 *
@@ -288,13 +288,15 @@ sshkey_tests(void)
288#endif 288#endif
289 289
290 TEST_START("generate KEY_RSA"); 290 TEST_START("generate KEY_RSA");
291 ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 768, &kr), 0); 291 ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 768, &kr),
292 SSH_ERR_INVALID_ARGUMENT);
293 ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &kr), 0);
292 ASSERT_PTR_NE(kr, NULL); 294 ASSERT_PTR_NE(kr, NULL);
293 ASSERT_PTR_NE(kr->rsa, NULL); 295 ASSERT_PTR_NE(kr->rsa, NULL);
294 ASSERT_PTR_NE(kr->rsa->n, NULL); 296 ASSERT_PTR_NE(kr->rsa->n, NULL);
295 ASSERT_PTR_NE(kr->rsa->e, NULL); 297 ASSERT_PTR_NE(kr->rsa->e, NULL);
296 ASSERT_PTR_NE(kr->rsa->p, NULL); 298 ASSERT_PTR_NE(kr->rsa->p, NULL);
297 ASSERT_INT_EQ(BN_num_bits(kr->rsa->n), 768); 299 ASSERT_INT_EQ(BN_num_bits(kr->rsa->n), 1024);
298 TEST_DONE(); 300 TEST_DONE();
299 301
300 TEST_START("generate KEY_DSA"); 302 TEST_START("generate KEY_DSA");
@@ -397,7 +399,7 @@ sshkey_tests(void)
397 TEST_DONE(); 399 TEST_DONE();
398 400
399 TEST_START("equal different keys"); 401 TEST_START("equal different keys");
400 ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 768, &k1), 0); 402 ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &k1), 0);
401 ASSERT_INT_EQ(sshkey_equal(kr, k1), 0); 403 ASSERT_INT_EQ(sshkey_equal(kr, k1), 0);
402 sshkey_free(k1); 404 sshkey_free(k1);
403 ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 1024, &k1), 0); 405 ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 1024, &k1), 0);