aboutsummaryrefslogtreecommitdiff
path: root/projects/opensc
diff options
context:
space:
mode:
authorFrank Morgner <frankmorgner@gmail.com>2019-08-22 16:57:42 +0200
committerjonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2019-08-22 10:57:42 -0400
commitaba3043190c4ab31073004143601ef2165b7f0d5 (patch)
treee59730c7a69b36fdb433142c6dc6b3a2c8fae4a8 /projects/opensc
parentd19a42cd4c41848c186fe77696b7cb3c07c917ed (diff)
downloadoss-fuzz-aba3043190c4ab31073004143601ef2165b7f0d5.tar.gz
[OpenSC] added fuzzing tests (#2726)
Diffstat (limited to 'projects/opensc')
-rw-r--r--projects/opensc/Dockerfile22
-rwxr-xr-xprojects/opensc/build.sh28
-rw-r--r--projects/opensc/project.yaml2
3 files changed, 52 insertions, 0 deletions
diff --git a/projects/opensc/Dockerfile b/projects/opensc/Dockerfile
new file mode 100644
index 000000000..eb8e30e97
--- /dev/null
+++ b/projects/opensc/Dockerfile
@@ -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/
diff --git a/projects/opensc/build.sh b/projects/opensc/build.sh
new file mode 100755
index 000000000..212d34a6b
--- /dev/null
+++ b/projects/opensc/build.sh
@@ -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
diff --git a/projects/opensc/project.yaml b/projects/opensc/project.yaml
index e552eb3d1..7dade9c1b 100644
--- a/projects/opensc/project.yaml
+++ b/projects/opensc/project.yaml
@@ -4,3 +4,5 @@ auto_ccs:
- "martin@martinpaljak.net"
- "viktor.tarasov@gmail.com"
- "ludovic.rousseau@gmail.com"
+fuzzing_engines:
+ - libfuzzer