Update fuzz targets

Prepare to run them in CI
This commit is contained in:
Joseph Birr-Pixton 2020-06-14 10:57:56 +01:00
parent 5a06734777
commit d6176ed6ac
2 changed files with 6 additions and 3 deletions

View File

@ -8,8 +8,11 @@ publish = false
[package.metadata]
cargo-fuzz = true
[dependencies]
webpki = "0.21.0"
[dependencies.rustls]
path = ".."
path = "../rustls"
[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"

View File

@ -2,12 +2,12 @@
#[macro_use] extern crate libfuzzer_sys;
extern crate rustls;
use rustls::{ServerConfig, ServerSession, Session};
use rustls::{ServerConfig, ServerSession, Session, NoClientAuth};
use std::io;
use std::sync::Arc;
fuzz_target!(|data: &[u8]| {
let config = Arc::new(ServerConfig::new());
let config = Arc::new(ServerConfig::new(NoClientAuth::new()));
let mut server= ServerSession::new(&config);
let _ = server.read_tls(&mut io::Cursor::new(data));
});