Skip to content

Commit

Permalink
configure fuzzing for fips203 (#13092)
Browse files Browse the repository at this point in the history
works locally

---------

Co-authored-by: Vitor Guidi <[email protected]>
  • Loading branch information
integritychain and vitorguidi authored Feb 24, 2025
1 parent f47a2da commit 7726a19
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
22 changes: 22 additions & 0 deletions projects/fips203/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 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 apt-get update && apt-get install -y make autoconf automake libtool
RUN git clone --depth 1 https://github.com/integritychain/fips203 # or use other version control
WORKDIR fips203
ENV FUZZING_LANGUAGE=rust
COPY build.sh $SRC/
25 changes: 25 additions & 0 deletions projects/fips203/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -eu
# Copyright 2025 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.
#
################################################################################

# build fuzzers, zip corpus

cd $SRC/fips203
cargo fuzz build -O --debug-assertions
cp fuzz/target/x86_64-unknown-linux-gnu/release/ml_kem_fuzz $OUT/
zip -q $OUT/ml_kem_fuzz_seed_corpus.zip fuzz/corpus/ml_kem_fuzz/*


5 changes: 5 additions & 0 deletions projects/fips203/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ language: rust
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
file_github_issue: true
sanitizers:
- address
fuzzing_engines:
- libfuzzer

0 comments on commit 7726a19

Please sign in to comment.