summaryrefslogtreecommitdiff
path: root/regress/unittests
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-05-08 06:08:42 +0000
committerDamien Miller <djm@mindrot.org>2017-05-08 16:11:26 +1000
commitd757a4b633e8874629a1442c7c2e7b1b55d28c19 (patch)
tree9aa9b5f0ebbd80795a14b1fb2adf5e84b8002dda /regress/unittests
parent2e58a69508ac49c02d1bb6057300fa6a76db1045 (diff)
upstream commit
fix for new SSH_ERR_KEY_LENGTH error value Upstream-Regress-ID: c38a6e6174d4c3feca3518df150d4fbae0dca8dc
Diffstat (limited to 'regress/unittests')
-rw-r--r--regress/unittests/sshkey/test_sshkey.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 32f8cb63..0a73322a 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.11 2017/04/30 23:33:48 djm Exp $ */
+/* $OpenBSD: test_sshkey.c,v 1.12 2017/05/08 06:08:42 djm Exp $ */
/*
* Regress test for sshkey.h key management API
*
@@ -253,19 +253,19 @@ sshkey_tests(void)
TEST_START("generate KEY_RSA too small modulus");
ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 128, &k1),
- SSH_ERR_INVALID_ARGUMENT);
+ SSH_ERR_KEY_LENGTH);
ASSERT_PTR_EQ(k1, NULL);
TEST_DONE();
TEST_START("generate KEY_RSA too large modulus");
ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1 << 20, &k1),
- SSH_ERR_INVALID_ARGUMENT);
+ SSH_ERR_KEY_LENGTH);
ASSERT_PTR_EQ(k1, NULL);
TEST_DONE();
TEST_START("generate KEY_DSA wrong bits");
ASSERT_INT_EQ(sshkey_generate(KEY_DSA, 2048, &k1),
- SSH_ERR_INVALID_ARGUMENT);
+ SSH_ERR_KEY_LENGTH);
ASSERT_PTR_EQ(k1, NULL);
sshkey_free(k1);
TEST_DONE();
@@ -273,7 +273,7 @@ sshkey_tests(void)
#ifdef OPENSSL_HAS_ECC
TEST_START("generate KEY_ECDSA wrong bits");
ASSERT_INT_EQ(sshkey_generate(KEY_ECDSA, 42, &k1),
- SSH_ERR_INVALID_ARGUMENT);
+ SSH_ERR_KEY_LENGTH);
ASSERT_PTR_EQ(k1, NULL);
sshkey_free(k1);
TEST_DONE();
@@ -281,7 +281,7 @@ sshkey_tests(void)
TEST_START("generate KEY_RSA");
ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 767, &kr),
- SSH_ERR_INVALID_ARGUMENT);
+ SSH_ERR_KEY_LENGTH);
ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &kr), 0);
ASSERT_PTR_NE(kr, NULL);
ASSERT_PTR_NE(kr->rsa, NULL);