From 635ed581a7b60d4815a8a354d5da586f11875824 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Fri, 26 Jul 2024 12:00:59 +1000 Subject: [PATCH] test: spdm-requester-emu: Remove the hello packet The hello message isn't used on QEMU [1] or SPDM-Utils [2], so let's remove it here as we don't need it and it breaks compability with other emulators. 1: https://github.com/qemu/qemu/blob/029e13a8a56a2931e7c24c0db52ae7256b932cb0/docs/specs/spdm.rst#L42 2: https://github.com/westerndigitalcorporation/spdm-utils Signed-off-by: Alistair Francis --- test/spdm-requester-emu/src/main.rs | 43 ----------------------------- 1 file changed, 43 deletions(-) diff --git a/test/spdm-requester-emu/src/main.rs b/test/spdm-requester-emu/src/main.rs index 017f7f3..e1b80d0 100644 --- a/test/spdm-requester-emu/src/main.rs +++ b/test/spdm-requester-emu/src/main.rs @@ -63,39 +63,6 @@ extern crate alloc; use alloc::sync::Arc; use core::ops::DerefMut; -#[maybe_async::maybe_async] -async fn send_receive_hello( - stream: Arc>, - transport_encap: Arc>, - transport_type: u32, -) { - println!("send test"); - let mut payload = [0u8; 1024]; - - let mut transport_encap = transport_encap.lock(); - let transport_encap = transport_encap.deref_mut(); - let used = transport_encap - .encap( - Arc::new(b"Client Hello!\0"), - Arc::new(Mutex::new(&mut payload[..])), - false, - ) - .await - .unwrap(); - - let _buffer_size = spdm_emu::spdm_emu::send_message( - stream.clone(), - transport_type, - SOCKET_SPDM_COMMAND_TEST, - &payload[0..used], - ); - let mut buffer = [0u8; config::RECEIVER_BUFFER_SIZE]; - let (_transport_type, _command, _payload) = - spdm_emu::spdm_emu::receive_message(stream, &mut buffer[..], ST1) - .await - .unwrap(); -} - #[maybe_async::maybe_async] async fn send_receive_stop( stream: Arc>, @@ -1535,16 +1502,6 @@ fn emu_main_inner() { SOCKET_TRANSPORT_TYPE_MCTP }; - #[cfg(not(feature = "is_sync"))] - block_on(Box::pin(send_receive_hello( - socket.clone(), - transport_encap.clone(), - transport_type, - ))); - - #[cfg(feature = "is_sync")] - send_receive_hello(socket.clone(), transport_encap.clone(), transport_type); - let socket_io_transport = SocketIoTransport::new(socket.clone()); let socket_io_transport: Arc> = Arc::new(Mutex::new(socket_io_transport));