diff options
author | Colin Watson <cjwatson@debian.org> | 2015-11-29 17:18:35 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2015-11-29 17:32:50 +0000 |
commit | 0b372585c0026f78676f1414510ec9f87a383803 (patch) | |
tree | a3fa6b329a8a5e9841b526f30332d21fc110118a /regress/unittests/sshkey/test_sshkey.c | |
parent | 24ffa45372888d206f21e1864e3911024c6d5e62 (diff) | |
parent | 6d0faf6dc76ac8cc73d6f8e478db7c97f7013a2d (diff) |
New upstream release (7.0p1).
Diffstat (limited to 'regress/unittests/sshkey/test_sshkey.c')
-rw-r--r-- | regress/unittests/sshkey/test_sshkey.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c index 4453a8599..9b3ce7ee4 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.4 2015/04/22 01:38:36 djm Exp $ */ | 1 | /* $OpenBSD: test_sshkey.c,v 1.7 2015/08/05 05:27:33 djm 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, 767, &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); |
@@ -424,7 +426,7 @@ sshkey_tests(void) | |||
424 | ASSERT_INT_EQ(sshkey_load_public(test_data_file("ed25519_1.pub"), | 426 | ASSERT_INT_EQ(sshkey_load_public(test_data_file("ed25519_1.pub"), |
425 | &k1, NULL), 0); | 427 | &k1, NULL), 0); |
426 | k2 = get_private("ed25519_2"); | 428 | k2 = get_private("ed25519_2"); |
427 | ASSERT_INT_EQ(sshkey_to_certified(k1, 0), 0); | 429 | ASSERT_INT_EQ(sshkey_to_certified(k1), 0); |
428 | ASSERT_PTR_NE(k1->cert, NULL); | 430 | ASSERT_PTR_NE(k1->cert, NULL); |
429 | k1->cert->type = SSH2_CERT_TYPE_USER; | 431 | k1->cert->type = SSH2_CERT_TYPE_USER; |
430 | k1->cert->serial = 1234; | 432 | k1->cert->serial = 1234; |