Skip to content

Commit 7726a19

Browse files
configure fuzzing for fips203 (#13092)
works locally --------- Co-authored-by: Vitor Guidi <[email protected]>
1 parent f47a2da commit 7726a19

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

projects/fips203/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
################################################################################
16+
17+
FROM gcr.io/oss-fuzz-base/base-builder-rust
18+
RUN apt-get update && apt-get install -y make autoconf automake libtool
19+
RUN git clone --depth 1 https://github.com/integritychain/fips203 # or use other version control
20+
WORKDIR fips203
21+
ENV FUZZING_LANGUAGE=rust
22+
COPY build.sh $SRC/

projects/fips203/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash -eu
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
# build fuzzers, zip corpus
19+
20+
cd $SRC/fips203
21+
cargo fuzz build -O --debug-assertions
22+
cp fuzz/target/x86_64-unknown-linux-gnu/release/ml_kem_fuzz $OUT/
23+
zip -q $OUT/ml_kem_fuzz_seed_corpus.zip fuzz/corpus/ml_kem_fuzz/*
24+
25+

projects/fips203/project.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ language: rust
44
primary_contact: "[email protected]"
55
auto_ccs:
66
7+
file_github_issue: true
8+
sanitizers:
9+
- address
10+
fuzzing_engines:
11+
- libfuzzer

0 commit comments

Comments
 (0)