]> git.lizzy.rs Git - rust.git/commitdiff
add issue-3234 test
authorrchaser53 <tayoshizawa29@gmail.com>
Thu, 7 Feb 2019 15:05:54 +0000 (00:05 +0900)
committerrchaser53 <tayoshizawa29@gmail.com>
Thu, 7 Feb 2019 15:05:54 +0000 (00:05 +0900)
this issue is already resolved

tests/source/issue-3234.rs [new file with mode: 0644]
tests/target/issue-3234.rs [new file with mode: 0644]

diff --git a/tests/source/issue-3234.rs b/tests/source/issue-3234.rs
new file mode 100644 (file)
index 0000000..120740a
--- /dev/null
@@ -0,0 +1,14 @@
+macro_rules! fuzz_target {
+    (|$data:ident: &[u8]| $body:block) => {};
+}
+
+fuzz_target!(|data: &[u8]| {
+
+    if let Ok(app_img) = AppImage::parse(data) {
+        if let Ok(app_img) = app_img.sign_for_secureboot(include_str!("../../test-data/signing-key")) {
+            assert!(app_img.is_signed());
+            Gbl::from_app_image(app_img).to_bytes();
+        }
+    }
+
+});
diff --git a/tests/target/issue-3234.rs b/tests/target/issue-3234.rs
new file mode 100644 (file)
index 0000000..c7d9d42
--- /dev/null
@@ -0,0 +1,14 @@
+macro_rules! fuzz_target {
+    (|$data:ident: &[u8]| $body:block) => {};
+}
+
+fuzz_target!(|data: &[u8]| {
+    if let Ok(app_img) = AppImage::parse(data) {
+        if let Ok(app_img) =
+            app_img.sign_for_secureboot(include_str!("../../test-data/signing-key"))
+        {
+            assert!(app_img.is_signed());
+            Gbl::from_app_image(app_img).to_bytes();
+        }
+    }
+});