mirror of
https://github.com/str4d/rage.git
synced 2025-04-03 19:07:42 +03:00
fuzz: Update fuzzer targets for recent changes
This commit is contained in:
parent
5207877992
commit
81f91581bf
2 changed files with 5 additions and 3 deletions
|
@ -7,7 +7,7 @@ fuzz_target!(|data: &[u8]| {
|
|||
if let Ok((leftover, stanza)) = read::age_stanza(data) {
|
||||
let mut buf = Vec::with_capacity(data.len());
|
||||
gen(
|
||||
write::age_stanza(stanza.tag, &stanza.args, &stanza.body),
|
||||
write::age_stanza(stanza.tag, &stanza.args, &stanza.body()),
|
||||
&mut buf,
|
||||
)
|
||||
.expect("can write to Vec");
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
use std::iter;
|
||||
|
||||
use age::Decryptor;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
if let Ok(decryptor) = Decryptor::new(data) {
|
||||
match decryptor {
|
||||
Decryptor::Recipients(d) => {
|
||||
let _ = d.decrypt(&[]);
|
||||
let _ = d.decrypt(iter::empty());
|
||||
}
|
||||
// Don't pay the cost of scrypt while fuzzing.
|
||||
Decryptor::Passphrase(_) => ()
|
||||
Decryptor::Passphrase(_) => (),
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue