diff options
author | Colin Watson <cjwatson@debian.org> | 2020-02-21 11:57:14 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-02-21 14:27:02 +0000 |
commit | 886e47e745586c34e81cfd5c5fb9b5dbc8e84d04 (patch) | |
tree | dd6c3b4dc64a17c520af7aaf213163f8a0a63e56 /regress/unittests/sshkey/test_fuzz.c | |
parent | ac2b4c0697fcac554041ab95f81736887eadf6ec (diff) | |
parent | a2dabf35ce0228c86a288d11cc847a9d9801604f (diff) |
New upstream release (8.2p1)
Diffstat (limited to 'regress/unittests/sshkey/test_fuzz.c')
-rw-r--r-- | regress/unittests/sshkey/test_fuzz.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/regress/unittests/sshkey/test_fuzz.c b/regress/unittests/sshkey/test_fuzz.c index 1323f8997..359811893 100644 --- a/regress/unittests/sshkey/test_fuzz.c +++ b/regress/unittests/sshkey/test_fuzz.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_fuzz.c,v 1.9 2018/10/17 23:28:05 djm Exp $ */ | 1 | /* $OpenBSD: test_fuzz.c,v 1.11 2019/11/25 10:32:35 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Fuzz tests for key parsing | 3 | * Fuzz tests for key parsing |
4 | * | 4 | * |
@@ -87,10 +87,11 @@ sig_fuzz(struct sshkey *k, const char *sig_alg) | |||
87 | if (test_is_slow()) | 87 | if (test_is_slow()) |
88 | fuzzers |= FUZZ_2_BIT_FLIP; | 88 | fuzzers |= FUZZ_2_BIT_FLIP; |
89 | 89 | ||
90 | ASSERT_INT_EQ(sshkey_sign(k, &sig, &l, c, sizeof(c), sig_alg, 0), 0); | 90 | ASSERT_INT_EQ(sshkey_sign(k, &sig, &l, c, sizeof(c), |
91 | sig_alg, NULL, 0), 0); | ||
91 | ASSERT_SIZE_T_GT(l, 0); | 92 | ASSERT_SIZE_T_GT(l, 0); |
92 | fuzz = fuzz_begin(fuzzers, sig, l); | 93 | fuzz = fuzz_begin(fuzzers, sig, l); |
93 | ASSERT_INT_EQ(sshkey_verify(k, sig, l, c, sizeof(c), NULL, 0), 0); | 94 | ASSERT_INT_EQ(sshkey_verify(k, sig, l, c, sizeof(c), NULL, 0, NULL), 0); |
94 | free(sig); | 95 | free(sig); |
95 | TEST_ONERROR(onerror, fuzz); | 96 | TEST_ONERROR(onerror, fuzz); |
96 | for(; !fuzz_done(fuzz); fuzz_next(fuzz)) { | 97 | for(; !fuzz_done(fuzz); fuzz_next(fuzz)) { |
@@ -98,7 +99,7 @@ sig_fuzz(struct sshkey *k, const char *sig_alg) | |||
98 | if (fuzz_matches_original(fuzz)) | 99 | if (fuzz_matches_original(fuzz)) |
99 | continue; | 100 | continue; |
100 | ASSERT_INT_NE(sshkey_verify(k, fuzz_ptr(fuzz), fuzz_len(fuzz), | 101 | ASSERT_INT_NE(sshkey_verify(k, fuzz_ptr(fuzz), fuzz_len(fuzz), |
101 | c, sizeof(c), NULL, 0), 0); | 102 | c, sizeof(c), NULL, 0, NULL), 0); |
102 | } | 103 | } |
103 | fuzz_cleanup(fuzz); | 104 | fuzz_cleanup(fuzz); |
104 | } | 105 | } |