Remove unwrap from fuzz targets that return errors

When fuzzing we are interested in what happens inside the target function
not necessarily what it returns. Functions returning errors with bogus
input in generally desired behaviour.
This commit is contained in:
Morgan Hill
2023-11-28 23:51:14 +01:00
committed by Karolin Varner
parent d539be3142
commit d44793e07f
2 changed files with 5 additions and 2 deletions

View File

@@ -9,5 +9,6 @@ fuzz_target!(|input: &[u8]| {
let mut ciphertext = [0u8; 188];
let mut shared_secret = [0u8; 32];
StaticKEM::encaps(&mut shared_secret, &mut ciphertext, input).unwrap();
// We expect errors while fuzzing therefore we do not check the result.
let _ = StaticKEM::encaps(&mut shared_secret, &mut ciphertext, input);
});