1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Files
libssh2/tests/ossfuzz/ossfuzz.sh
Viktor Szakats 3e14d67d26 mac: disable SHA1-based MACs by default
Also:
- RELEASE-NOTES: announce removal after next release.
- allow build-time macro to enable in the meantime.
- skip in tests if disabled.
- keep testing in CI with other legacy options.
- workaround oss-fuzzer hang and timeout after 10 minutes by keeping
  SHA1-based MACs enabled in the fuzzer build.
  Ref: https://github.com/libssh2/libssh2/pull/2444#issuecomment-5110853610

Follow-up to 99f935358d #2443

Closes #2444
2026-07-29 02:53:01 +02:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (C) The libssh2 project and its contributors.
# SPDX-License-Identifier: BSD-3-Clause
set -eu
# This script is called by the oss-fuzz main project when compiling the fuzz
# targets. This script is regression tested by ci/ossfuzz.sh.
# Save off the current folder as the build root.
export BUILD_ROOT="$PWD"
export CPPFLAGS
CPPFLAGS+=' -DLIBSSH2_HMAC_SHA1_ENABLE' # Workaround for hang then timeout
echo "CC: ${CC:-}"
echo "CXX: ${CXX:-}"
echo "LIB_FUZZING_ENGINE: ${LIB_FUZZING_ENGINE:-}"
echo "CFLAGS: ${CFLAGS:-}"
echo "CXXFLAGS: ${CXXFLAGS:-}"
echo "CPPFLAGS: ${CPPFLAGS:-}"
echo "OUT: ${OUT:-}"
MAKEFLAGS+=" -j$(nproc)"
export MAKEFLAGS
# Install dependencies
apt-get -y install automake libtool libssl-dev zlib1g-dev
# Compile the fuzzer.
autoreconf -fi
./configure --disable-dependency-tracking \
--disable-shared \
--enable-ossfuzzers \
--disable-examples-build \
--disable-docs \
--enable-debug
make V=1
# Copy the fuzzer to the output directory.
cp -v tests/ossfuzz/ssh2_client_fuzzer "$OUT/"