Lines Matching full:fuzz

3  * Fuzz tests for key parsing
43 onerror(void *fuzz) in onerror() argument
45 fprintf(stderr, "Failed during fuzz:\n"); in onerror()
46 fuzz_dump((struct fuzz *)fuzz); in onerror()
54 struct fuzz *fuzz; in public_fuzz() local
64 fuzz = fuzz_begin(fuzzers, sshbuf_mutable_ptr(buf), sshbuf_len(buf)); in public_fuzz()
69 TEST_ONERROR(onerror, fuzz); in public_fuzz()
70 for(; !fuzz_done(fuzz); fuzz_next(fuzz)) { in public_fuzz()
71 if (sshkey_from_blob(fuzz_ptr(fuzz), fuzz_len(fuzz), &k1) == 0) in public_fuzz()
74 fuzz_cleanup(fuzz); in public_fuzz()
80 struct fuzz *fuzz; in sig_fuzz() local
94 fuzz = fuzz_begin(fuzzers, sig, l); in sig_fuzz()
97 TEST_ONERROR(onerror, fuzz); in sig_fuzz()
98 for(; !fuzz_done(fuzz); fuzz_next(fuzz)) { in sig_fuzz()
100 if (fuzz_matches_original(fuzz)) in sig_fuzz()
102 ASSERT_INT_NE(sshkey_verify(k, fuzz_ptr(fuzz), fuzz_len(fuzz), in sig_fuzz()
105 fuzz_cleanup(fuzz); in sig_fuzz()
115 struct fuzz *fuzz; in sshkey_fuzz_tests() local
119 TEST_START("fuzz RSA private"); in sshkey_fuzz_tests()
121 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
127 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
128 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
129 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
138 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
141 TEST_START("fuzz RSA new-format private"); in sshkey_fuzz_tests()
143 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
149 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
150 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
151 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
160 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
164 TEST_START("fuzz DSA private"); in sshkey_fuzz_tests()
166 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
172 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
173 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
174 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
183 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
186 TEST_START("fuzz DSA new-format private"); in sshkey_fuzz_tests()
188 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
194 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
195 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
196 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
205 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
210 TEST_START("fuzz ECDSA private"); in sshkey_fuzz_tests()
212 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
218 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
219 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
220 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
229 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
232 TEST_START("fuzz ECDSA new-format private"); in sshkey_fuzz_tests()
234 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
240 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
241 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
242 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
251 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
256 TEST_START("fuzz Ed25519 private"); in sshkey_fuzz_tests()
258 fuzz = fuzz_begin(FUZZ_BASE64, sshbuf_mutable_ptr(buf), in sshkey_fuzz_tests()
264 TEST_ONERROR(onerror, fuzz); in sshkey_fuzz_tests()
265 for(i = 0; !fuzz_done(fuzz); i++, fuzz_next(fuzz)) { in sshkey_fuzz_tests()
266 r = sshbuf_put(fuzzed, fuzz_ptr(fuzz), fuzz_len(fuzz)); in sshkey_fuzz_tests()
275 fuzz_cleanup(fuzz); in sshkey_fuzz_tests()
279 TEST_START("fuzz RSA public"); in sshkey_fuzz_tests()
287 TEST_START("fuzz RSA cert"); in sshkey_fuzz_tests()
294 TEST_START("fuzz DSA public"); in sshkey_fuzz_tests()
302 TEST_START("fuzz DSA cert"); in sshkey_fuzz_tests()
310 TEST_START("fuzz ECDSA public"); in sshkey_fuzz_tests()
318 TEST_START("fuzz ECDSA cert"); in sshkey_fuzz_tests()
326 TEST_START("fuzz Ed25519 public"); in sshkey_fuzz_tests()
334 TEST_START("fuzz Ed25519 cert"); in sshkey_fuzz_tests()
341 TEST_START("fuzz RSA sig"); in sshkey_fuzz_tests()
349 TEST_START("fuzz RSA SHA256 sig"); in sshkey_fuzz_tests()
357 TEST_START("fuzz RSA SHA512 sig"); in sshkey_fuzz_tests()
366 TEST_START("fuzz DSA sig"); in sshkey_fuzz_tests()
376 TEST_START("fuzz ECDSA sig"); in sshkey_fuzz_tests()
386 TEST_START("fuzz Ed25519 sig"); in sshkey_fuzz_tests()
394 /* XXX fuzz decoded new-format blobs too */ in sshkey_fuzz_tests()
395 /* XXX fuzz XMSS too */ in sshkey_fuzz_tests()