From 3bdb41cb4212a43358889ced288c274d64878956 Mon Sep 17 00:00:00 2001 From: Lu Xiaoyu <50605570+xiaoyuxlu@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:19:39 +0800 Subject: [PATCH] [spdm-rs]: add initial integration for spdm-rs (#11671) The `spdm-rs` provides a Rust language implementation of [SPDM](https://www.dmtf.org/standards/spdm) which is used to for Trusted Execution Environment I/O (TEE-I/O) in Confidential Computing. Project repo: https://github.com/ccc-spdm-tools/spdm-rs Signed-off-by: xiaoyuxlu --- projects/spdm-rs/Dockerfile | 20 ++++++++++++++++++++ projects/spdm-rs/build.sh | 34 ++++++++++++++++++++++++++++++++++ projects/spdm-rs/project.yaml | 11 +++++++++++ 3 files changed, 65 insertions(+) create mode 100644 projects/spdm-rs/Dockerfile create mode 100644 projects/spdm-rs/build.sh create mode 100644 projects/spdm-rs/project.yaml diff --git a/projects/spdm-rs/Dockerfile b/projects/spdm-rs/Dockerfile new file mode 100644 index 000000000..f50fea863 --- /dev/null +++ b/projects/spdm-rs/Dockerfile @@ -0,0 +1,20 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder-rust +RUN git clone --depth 1 --recursive https://github.com/ccc-spdm-tools/spdm-rs.git +COPY build.sh $SRC/ +WORKDIR $SRC/spdm-rs diff --git a/projects/spdm-rs/build.sh b/projects/spdm-rs/build.sh new file mode 100644 index 000000000..5b8ad5964 --- /dev/null +++ b/projects/spdm-rs/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash -eu +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +set -eox pipefail +pushd $SRC/spdm-rs + +export CARGO_TARGET_DIR=$SRC/spdm-rs/target +FUZZ_TARGET_OUTPUT_DIR=${CARGO_TARGET_DIR}/x86_64-unknown-linux-gnu/release + +bash sh_script/pre-build.sh + +pushd spdmlib +cargo fuzz build --release +for f in fuzz/fuzz_targets/*.rs +do + FUZZ_TARGET_NAME=$(basename ${f%.*}) + cp $FUZZ_TARGET_OUTPUT_DIR/$FUZZ_TARGET_NAME $OUT/ +done +popd # spdmlib + +popd # $SRC/spdm-rs diff --git a/projects/spdm-rs/project.yaml b/projects/spdm-rs/project.yaml new file mode 100644 index 000000000..681b79c58 --- /dev/null +++ b/projects/spdm-rs/project.yaml @@ -0,0 +1,11 @@ +homepage: "https://github.com/ccc-spdm-tools/spdm-rs" +main_repo: 'https://github.com/ccc-spdm-tools/spdm-rs.git' +language: rust +primary_contact: "xiaoyu1.lu@intel.com" +auto_ccs: + - "jiewen.yao@intel.com" + - "longlong.yang@intel.com" +sanitizers: + - address +fuzzing_engines: + - libfuzzer \ No newline at end of file