[OpenSC] added fuzzing tests (#2726)

This commit is contained in:
Frank Morgner 2019-08-22 16:57:42 +02:00 committed by jonathanmetzman
parent d19a42cd4c
commit aba3043190
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Copyright 2019 Google Inc.
#
# 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
MAINTAINER frankmorgner@gmail.com
RUN apt-get update && apt-get install -y pcscd libccid libpcsclite-dev libssl-dev libreadline-dev autoconf automake build-essential docbook-xsl xsltproc libtool pkg-config zlib1g-dev
RUN git clone --depth 1 --single-branch --branch master https://github.com/OpenSC/OpenSC opensc
WORKDIR opensc
COPY build.sh $SRC/

28
projects/opensc/build.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash -eu
# Copyright 2019 Google Inc.
#
# 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.
#
################################################################################
./bootstrap
# FIXME FUZZING_LIBS="$LIB_FUZZING_ENGINE" fails with some missing C++ library, I don't know how to fix this
./configure --disable-shared --disable-pcsc --enable-ctapi --enable-fuzzing FUZZING_LIBS="$LIB_FUZZING_ENGINE"
make -j4
cp src/tests/fuzzing/fuzz_asn1_print $OUT
cp src/tests/fuzzing/fuzz_asn1_sig_value $OUT
cp src/tests/fuzzing/fuzz_pkcs15_decode $OUT
cp src/tests/fuzzing/fuzz_pkcs15_reader $OUT
#cp src/tests/fuzzing/fuzz_pkcs15_reader.options $OUT

View File

@ -4,3 +4,5 @@ auto_ccs:
- "martin@martinpaljak.net"
- "viktor.tarasov@gmail.com"
- "ludovic.rousseau@gmail.com"
fuzzing_engines:
- libfuzzer