From 81b2bb4caeb98508b7411b3816372a904639d99f Mon Sep 17 00:00:00 2001 From: "Lu, Xiaoyu1" Date: Thu, 29 Feb 2024 20:12:13 -0500 Subject: [PATCH] Fix libfuzzer build issue. 1. Fix libfuzzer cases build issues. 2. add libfuzzer cases to build.sh. Signed-off-by: xiaoyuxlu --- fuzz-target/fuzzlib/src/lib.rs | 2 +- fuzz-target/requester/version_req/src/main.rs | 3 +-- sh_script/fuzz_run.sh | 3 +++ spdmlib/fuzz/fuzz_targets/algorithm_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/algorithm_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/capability_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/capability_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/certificate_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/certificate_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/challenge_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/challenge_rsp.rs | 2 +- .../deliver_encapsulated_response_certificate_rsp.rs | 2 +- .../fuzz_targets/deliver_encapsulated_response_digest_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/digest_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/digest_rsp.rs | 2 +- .../fuzz/fuzz_targets/encapsulated_request_certificate_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/encapsulated_request_digest_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/encapsulated_request_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/end_session_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/end_session_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/finish_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/finish_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/get_encapsulated_request_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/heartbeat_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/heartbeat_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/key_exchange_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/key_update_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/key_update_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/keyexchange_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/measurement_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/measurement_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/psk_exchange_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/psk_finish_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/psk_finish_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/pskexchange_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/vendor_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/vendor_rsp.rs | 2 +- spdmlib/fuzz/fuzz_targets/version_req.rs | 2 +- spdmlib/fuzz/fuzz_targets/version_rsp.rs | 2 +- 40 files changed, 42 insertions(+), 40 deletions(-) diff --git a/fuzz-target/fuzzlib/src/lib.rs b/fuzz-target/fuzzlib/src/lib.rs index 6c26f14..97e19a2 100644 --- a/fuzz-target/fuzzlib/src/lib.rs +++ b/fuzz-target/fuzzlib/src/lib.rs @@ -22,7 +22,7 @@ pub use spdmlib; pub use spdmlib::common::{SpdmDeviceIo, SpdmTransportEncap}; pub use spdmlib::error::SpdmResult; pub use spdmlib::{common, config, error, protocol, requester, responder}; -pub use spin; +pub use spin::{self, Mutex}; pub use flexi_logger; pub use flexi_logger::FileSpec; diff --git a/fuzz-target/requester/version_req/src/main.rs b/fuzz-target/requester/version_req/src/main.rs index a25f003..c0956a9 100644 --- a/fuzz-target/requester/version_req/src/main.rs +++ b/fuzz-target/requester/version_req/src/main.rs @@ -8,13 +8,12 @@ use fuzzlib::{ spdmlib::protocol::MAX_SPDM_VERSION_COUNT, spdmlib::{protocol::SpdmVersion, requester::RequesterContext}, time::SPDM_TIME_IMPL, - PciDoeTransportEncap, SharedBuffer, SECRET_ASYM_IMPL_INSTANCE, + Mutex, PciDoeTransportEncap, SharedBuffer, SECRET_ASYM_IMPL_INSTANCE, }; #[allow(unused)] use fuzzlib::flexi_logger; -use spin::Mutex; extern crate alloc; use alloc::boxed::Box; use alloc::sync::Arc; diff --git a/sh_script/fuzz_run.sh b/sh_script/fuzz_run.sh index a60cc46..b92f7a1 100755 --- a/sh_script/fuzz_run.sh +++ b/sh_script/fuzz_run.sh @@ -165,6 +165,9 @@ if [[ $fuzz_target_name ]]; then else set -x cargo afl build --features "fuzz ${MUT_AUTH_FEATURE}" ${FUZZ_NO_DEFAULT_FEATURES} $buildpackage + pushd spdmlib + cargo fuzz build --release + popd set -x fi diff --git a/spdmlib/fuzz/fuzz_targets/algorithm_req.rs b/spdmlib/fuzz/fuzz_targets/algorithm_req.rs index 2e39217..feaef75 100644 --- a/spdmlib/fuzz/fuzz_targets/algorithm_req.rs +++ b/spdmlib/fuzz/fuzz_targets/algorithm_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/algorithm_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_algorithm(data); + let _ = fuzz_send_receive_spdm_algorithm(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/algorithm_rsp.rs b/spdmlib/fuzz/fuzz_targets/algorithm_rsp.rs index c741568..e101cee 100644 --- a/spdmlib/fuzz/fuzz_targets/algorithm_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/algorithm_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/algorithm_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_algorithm(data); + let _ = fuzz_handle_spdm_algorithm(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/capability_req.rs b/spdmlib/fuzz/fuzz_targets/capability_req.rs index 8cb722d..d29d614 100644 --- a/spdmlib/fuzz/fuzz_targets/capability_req.rs +++ b/spdmlib/fuzz/fuzz_targets/capability_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/capability_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_capability(data); + let _ = fuzz_send_receive_spdm_capability(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/capability_rsp.rs b/spdmlib/fuzz/fuzz_targets/capability_rsp.rs index 7c748f0..951014c 100644 --- a/spdmlib/fuzz/fuzz_targets/capability_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/capability_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/capability_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_capability(data); + let _ = fuzz_handle_spdm_capability(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/certificate_req.rs b/spdmlib/fuzz/fuzz_targets/certificate_req.rs index a23f28a..85f093f 100644 --- a/spdmlib/fuzz/fuzz_targets/certificate_req.rs +++ b/spdmlib/fuzz/fuzz_targets/certificate_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/certificate_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_certificate(data); + let _ = fuzz_send_receive_spdm_certificate(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/certificate_rsp.rs b/spdmlib/fuzz/fuzz_targets/certificate_rsp.rs index e3cddad..230b87c 100644 --- a/spdmlib/fuzz/fuzz_targets/certificate_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/certificate_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/certificate_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_certificate(data); + let _ = fuzz_handle_spdm_certificate(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/challenge_req.rs b/spdmlib/fuzz/fuzz_targets/challenge_req.rs index 2851b06..cfe99ec 100644 --- a/spdmlib/fuzz/fuzz_targets/challenge_req.rs +++ b/spdmlib/fuzz/fuzz_targets/challenge_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/challenge_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_challenge(data); + let _ = fuzz_send_receive_spdm_challenge(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/challenge_rsp.rs b/spdmlib/fuzz/fuzz_targets/challenge_rsp.rs index 746637c..6e56fbb 100644 --- a/spdmlib/fuzz/fuzz_targets/challenge_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/challenge_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/challenge_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_challenge(data); + let _ = fuzz_handle_spdm_challenge(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_certificate_rsp.rs b/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_certificate_rsp.rs index c33fee6..564c13f 100644 --- a/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_certificate_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_certificate_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/deliver_encapsulated_response_certifica fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_encap_response_certificate(data); + let _ = fuzz_handle_encap_response_certificate(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_digest_rsp.rs b/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_digest_rsp.rs index 367d9d8..f21ac28 100644 --- a/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_digest_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_digest_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/deliver_encapsulated_response_digest_rs fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_encap_response_digest(data); + let _ = fuzz_handle_encap_response_digest(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_rsp.rs b/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_rsp.rs index 8261ae9..50f5e28 100644 --- a/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/deliver_encapsulated_response_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/deliver_encapsulated_response_rsp/src/m fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_deliver_encapsulated_reponse(data); + let _ = fuzz_handle_deliver_encapsulated_reponse(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/digest_req.rs b/spdmlib/fuzz/fuzz_targets/digest_req.rs index ed47a80..f3fcbbd 100644 --- a/spdmlib/fuzz/fuzz_targets/digest_req.rs +++ b/spdmlib/fuzz/fuzz_targets/digest_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/digest_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_digest(data); + let _ = fuzz_send_receive_spdm_digest(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/digest_rsp.rs b/spdmlib/fuzz/fuzz_targets/digest_rsp.rs index 764786b..0795826 100644 --- a/spdmlib/fuzz/fuzz_targets/digest_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/digest_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/digest_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_digest(data); + let _ = fuzz_handle_spdm_digest(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/encapsulated_request_certificate_req.rs b/spdmlib/fuzz/fuzz_targets/encapsulated_request_certificate_req.rs index 6204f5b..6661b86 100644 --- a/spdmlib/fuzz/fuzz_targets/encapsulated_request_certificate_req.rs +++ b/spdmlib/fuzz/fuzz_targets/encapsulated_request_certificate_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/encapsulated_request_certificate_req/sr fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_encap_handle_get_certificate(data); + let _ = fuzz_encap_handle_get_certificate(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/encapsulated_request_digest_req.rs b/spdmlib/fuzz/fuzz_targets/encapsulated_request_digest_req.rs index a143122..081ea53 100644 --- a/spdmlib/fuzz/fuzz_targets/encapsulated_request_digest_req.rs +++ b/spdmlib/fuzz/fuzz_targets/encapsulated_request_digest_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/encapsulated_request_digest_req/src/mai fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_encap_handle_get_digest(data); + let _ = fuzz_encap_handle_get_digest(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/encapsulated_request_req.rs b/spdmlib/fuzz/fuzz_targets/encapsulated_request_req.rs index fb164ab..0f40f5c 100644 --- a/spdmlib/fuzz/fuzz_targets/encapsulated_request_req.rs +++ b/spdmlib/fuzz/fuzz_targets/encapsulated_request_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/encapsulated_request_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_session_based_mutual_authenticate(data); + let _ = fuzz_session_based_mutual_authenticate(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/end_session_req.rs b/spdmlib/fuzz/fuzz_targets/end_session_req.rs index 99dbd89..474fd37 100644 --- a/spdmlib/fuzz/fuzz_targets/end_session_req.rs +++ b/spdmlib/fuzz/fuzz_targets/end_session_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/end_session_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_end_session(data); + let _ = fuzz_send_receive_spdm_end_session(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/end_session_rsp.rs b/spdmlib/fuzz/fuzz_targets/end_session_rsp.rs index 4852bbe..2c9cb6e 100644 --- a/spdmlib/fuzz/fuzz_targets/end_session_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/end_session_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/end_session_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_end_session(data); + let _ = fuzz_handle_spdm_end_session(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/finish_req.rs b/spdmlib/fuzz/fuzz_targets/finish_req.rs index 4d51cbb..aebf63a 100644 --- a/spdmlib/fuzz/fuzz_targets/finish_req.rs +++ b/spdmlib/fuzz/fuzz_targets/finish_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/finish_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_finish(data); + let _ = fuzz_send_receive_spdm_finish(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/finish_rsp.rs b/spdmlib/fuzz/fuzz_targets/finish_rsp.rs index 6ecb0fb..f8d215f 100644 --- a/spdmlib/fuzz/fuzz_targets/finish_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/finish_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/finish_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_finish(data); + let _ = fuzz_handle_spdm_finish(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/get_encapsulated_request_rsp.rs b/spdmlib/fuzz/fuzz_targets/get_encapsulated_request_rsp.rs index 5aeaa0d..8181835 100644 --- a/spdmlib/fuzz/fuzz_targets/get_encapsulated_request_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/get_encapsulated_request_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/get_encapsulated_request_rsp/src/main.r fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_get_encapsulated_request(data); + let _ = fuzz_handle_get_encapsulated_request(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/heartbeat_req.rs b/spdmlib/fuzz/fuzz_targets/heartbeat_req.rs index 51e4d65..a5523f0 100644 --- a/spdmlib/fuzz/fuzz_targets/heartbeat_req.rs +++ b/spdmlib/fuzz/fuzz_targets/heartbeat_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/heartbeat_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_heartbeat(data); + let _ = fuzz_send_receive_spdm_heartbeat(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/heartbeat_rsp.rs b/spdmlib/fuzz/fuzz_targets/heartbeat_rsp.rs index 6f711f7..dde3434 100644 --- a/spdmlib/fuzz/fuzz_targets/heartbeat_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/heartbeat_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/heartbeat_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_heartbeat(data); + let _ = fuzz_handle_spdm_heartbeat(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/key_exchange_req.rs b/spdmlib/fuzz/fuzz_targets/key_exchange_req.rs index 7574abc..cecd410 100644 --- a/spdmlib/fuzz/fuzz_targets/key_exchange_req.rs +++ b/spdmlib/fuzz/fuzz_targets/key_exchange_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/key_exchange_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_key_exchange(data); + let _ = fuzz_send_receive_spdm_key_exchange(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/key_update_req.rs b/spdmlib/fuzz/fuzz_targets/key_update_req.rs index b02c49c..1e30046 100644 --- a/spdmlib/fuzz/fuzz_targets/key_update_req.rs +++ b/spdmlib/fuzz/fuzz_targets/key_update_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/key_update_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_key_update(data); + let _ = fuzz_send_receive_spdm_key_update(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/key_update_rsp.rs b/spdmlib/fuzz/fuzz_targets/key_update_rsp.rs index ea414a0..7e72d31 100644 --- a/spdmlib/fuzz/fuzz_targets/key_update_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/key_update_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/key_update_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_key_update(data); + let _ = fuzz_handle_spdm_key_update(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/keyexchange_rsp.rs b/spdmlib/fuzz/fuzz_targets/keyexchange_rsp.rs index 25dbb2b..e8370ab 100644 --- a/spdmlib/fuzz/fuzz_targets/keyexchange_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/keyexchange_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/keyexchange_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_key_exchange(data); + let _ = fuzz_handle_spdm_key_exchange(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/measurement_req.rs b/spdmlib/fuzz/fuzz_targets/measurement_req.rs index e6e8a2f..518ee6b 100644 --- a/spdmlib/fuzz/fuzz_targets/measurement_req.rs +++ b/spdmlib/fuzz/fuzz_targets/measurement_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/measurement_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_measurement(data); + let _ = fuzz_send_receive_spdm_measurement(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/measurement_rsp.rs b/spdmlib/fuzz/fuzz_targets/measurement_rsp.rs index 38eeb33..c0bd24c 100644 --- a/spdmlib/fuzz/fuzz_targets/measurement_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/measurement_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/measurement_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_measurement(data); + let _ = fuzz_handle_spdm_measurement(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/psk_exchange_req.rs b/spdmlib/fuzz/fuzz_targets/psk_exchange_req.rs index e36fc74..399e970 100644 --- a/spdmlib/fuzz/fuzz_targets/psk_exchange_req.rs +++ b/spdmlib/fuzz/fuzz_targets/psk_exchange_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/psk_exchange_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_psk_exchange(data); + let _ = fuzz_send_receive_spdm_psk_exchange(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/psk_finish_req.rs b/spdmlib/fuzz/fuzz_targets/psk_finish_req.rs index a06ba6f..992dc78 100644 --- a/spdmlib/fuzz/fuzz_targets/psk_finish_req.rs +++ b/spdmlib/fuzz/fuzz_targets/psk_finish_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/psk_finish_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_psk_finish(data); + let _ = fuzz_send_receive_spdm_psk_finish(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/psk_finish_rsp.rs b/spdmlib/fuzz/fuzz_targets/psk_finish_rsp.rs index adc494e..129607f 100644 --- a/spdmlib/fuzz/fuzz_targets/psk_finish_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/psk_finish_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/psk_finish_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_psk_finish(data); + let _ = fuzz_handle_spdm_psk_finish(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/pskexchange_rsp.rs b/spdmlib/fuzz/fuzz_targets/pskexchange_rsp.rs index 17580be..01c15e6 100644 --- a/spdmlib/fuzz/fuzz_targets/pskexchange_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/pskexchange_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/pskexchange_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_psk_exchange(data); + let _ = fuzz_handle_spdm_psk_exchange(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/vendor_req.rs b/spdmlib/fuzz/fuzz_targets/vendor_req.rs index 321d5b8..876f9c2 100644 --- a/spdmlib/fuzz/fuzz_targets/vendor_req.rs +++ b/spdmlib/fuzz/fuzz_targets/vendor_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/vendor_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_spdm_vendor_defined_request(data); + let _ = fuzz_send_spdm_vendor_defined_request(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/vendor_rsp.rs b/spdmlib/fuzz/fuzz_targets/vendor_rsp.rs index 3669acc..0fd54e3 100644 --- a/spdmlib/fuzz/fuzz_targets/vendor_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/vendor_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/vendor_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_vendor_defined_request(data); + let _ = fuzz_handle_spdm_vendor_defined_request(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/version_req.rs b/spdmlib/fuzz/fuzz_targets/version_req.rs index 6617184..30aab6f 100644 --- a/spdmlib/fuzz/fuzz_targets/version_req.rs +++ b/spdmlib/fuzz/fuzz_targets/version_req.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/requester/version_req/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_send_receive_spdm_version(data); + let _ = fuzz_send_receive_spdm_version(Arc::new(data.to_vec())); }); diff --git a/spdmlib/fuzz/fuzz_targets/version_rsp.rs b/spdmlib/fuzz/fuzz_targets/version_rsp.rs index f1b2d0d..c0b2640 100644 --- a/spdmlib/fuzz/fuzz_targets/version_rsp.rs +++ b/spdmlib/fuzz/fuzz_targets/version_rsp.rs @@ -10,5 +10,5 @@ include!("../../../fuzz-target/responder/version_rsp/src/main.rs"); fuzz_target!(|data: &[u8]| { // fuzzed code goes here - fuzz_handle_spdm_version(data); + let _ = fuzz_handle_spdm_version(Arc::new(data.to_vec())); });