Skip to content

Commit 44d6f7c

Browse files
authored
Merge pull request rust-lang#3332 from rchaser53/issue-3234
add issue-3234 test
2 parents 672f352 + 5e53098 commit 44d6f7c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/source/issue-3234.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
macro_rules! fuzz_target {
2+
(|$data:ident: &[u8]| $body:block) => {};
3+
}
4+
5+
fuzz_target!(|data: &[u8]| {
6+
7+
if let Ok(app_img) = AppImage::parse(data) {
8+
if let Ok(app_img) = app_img.sign_for_secureboot(include_str!("../../test-data/signing-key")) {
9+
assert!(app_img.is_signed());
10+
Gbl::from_app_image(app_img).to_bytes();
11+
}
12+
}
13+
14+
});

tests/target/issue-3234.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
macro_rules! fuzz_target {
2+
(|$data:ident: &[u8]| $body:block) => {};
3+
}
4+
5+
fuzz_target!(|data: &[u8]| {
6+
if let Ok(app_img) = AppImage::parse(data) {
7+
if let Ok(app_img) =
8+
app_img.sign_for_secureboot(include_str!("../../test-data/signing-key"))
9+
{
10+
assert!(app_img.is_signed());
11+
Gbl::from_app_image(app_img).to_bytes();
12+
}
13+
}
14+
});

0 commit comments

Comments
 (0)