diff options
Diffstat (limited to 'regress/unittests/sshkey')
-rw-r--r-- | regress/unittests/sshkey/test_sshkey.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c index 32f8cb63c..0a73322a3 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.11 2017/04/30 23:33:48 djm Exp $ */ | 1 | /* $OpenBSD: test_sshkey.c,v 1.12 2017/05/08 06:08:42 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Regress test for sshkey.h key management API | 3 | * Regress test for sshkey.h key management API |
4 | * | 4 | * |
@@ -253,19 +253,19 @@ sshkey_tests(void) | |||
253 | 253 | ||
254 | TEST_START("generate KEY_RSA too small modulus"); | 254 | TEST_START("generate KEY_RSA too small modulus"); |
255 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 128, &k1), | 255 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 128, &k1), |
256 | SSH_ERR_INVALID_ARGUMENT); | 256 | SSH_ERR_KEY_LENGTH); |
257 | ASSERT_PTR_EQ(k1, NULL); | 257 | ASSERT_PTR_EQ(k1, NULL); |
258 | TEST_DONE(); | 258 | TEST_DONE(); |
259 | 259 | ||
260 | TEST_START("generate KEY_RSA too large modulus"); | 260 | TEST_START("generate KEY_RSA too large modulus"); |
261 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1 << 20, &k1), | 261 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1 << 20, &k1), |
262 | SSH_ERR_INVALID_ARGUMENT); | 262 | SSH_ERR_KEY_LENGTH); |
263 | ASSERT_PTR_EQ(k1, NULL); | 263 | ASSERT_PTR_EQ(k1, NULL); |
264 | TEST_DONE(); | 264 | TEST_DONE(); |
265 | 265 | ||
266 | TEST_START("generate KEY_DSA wrong bits"); | 266 | TEST_START("generate KEY_DSA wrong bits"); |
267 | ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 2048, &k1), | 267 | ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 2048, &k1), |
268 | SSH_ERR_INVALID_ARGUMENT); | 268 | SSH_ERR_KEY_LENGTH); |
269 | ASSERT_PTR_EQ(k1, NULL); | 269 | ASSERT_PTR_EQ(k1, NULL); |
270 | sshkey_free(k1); | 270 | sshkey_free(k1); |
271 | TEST_DONE(); | 271 | TEST_DONE(); |
@@ -273,7 +273,7 @@ sshkey_tests(void) | |||
273 | #ifdef OPENSSL_HAS_ECC | 273 | #ifdef OPENSSL_HAS_ECC |
274 | TEST_START("generate KEY_ECDSA wrong bits"); | 274 | TEST_START("generate KEY_ECDSA wrong bits"); |
275 | ASSERT_INT_EQ(sshkey_generate(KEY_ECDSA, 42, &k1), | 275 | ASSERT_INT_EQ(sshkey_generate(KEY_ECDSA, 42, &k1), |
276 | SSH_ERR_INVALID_ARGUMENT); | 276 | SSH_ERR_KEY_LENGTH); |
277 | ASSERT_PTR_EQ(k1, NULL); | 277 | ASSERT_PTR_EQ(k1, NULL); |
278 | sshkey_free(k1); | 278 | sshkey_free(k1); |
279 | TEST_DONE(); | 279 | TEST_DONE(); |
@@ -281,7 +281,7 @@ sshkey_tests(void) | |||
281 | 281 | ||
282 | TEST_START("generate KEY_RSA"); | 282 | TEST_START("generate KEY_RSA"); |
283 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 767, &kr), | 283 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 767, &kr), |
284 | SSH_ERR_INVALID_ARGUMENT); | 284 | SSH_ERR_KEY_LENGTH); |
285 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &kr), 0); | 285 | ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &kr), 0); |
286 | ASSERT_PTR_NE(kr, NULL); | 286 | ASSERT_PTR_NE(kr, NULL); |
287 | ASSERT_PTR_NE(kr->rsa, NULL); | 287 | ASSERT_PTR_NE(kr->rsa, NULL); |