Skip to content

Commit 87de00d

Browse files
committed
Fuzzing: build with ASAN as well
1 parent 4485965 commit 87de00d

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/build_and_fuzz.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,35 @@ jobs:
2626
-DENABLE_STATIC=ON \
2727
-B build-msan
2828
cmake --build build-msan
29+
30+
fuzz_asan:
31+
name: fuzz with AddressSanitizer
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
36+
- name: install dependencies from package management
37+
env:
38+
DEBIAN_FRONTEND: noninteractive
39+
run: |
40+
apt -q -y update
41+
apt -q -y install \
42+
llvm-16 clang-16 lld-16 \
43+
build-essential cmake ninja-build pkg-config \
44+
libedit-dev libcurl4-openssl-dev libusb-1.0-0-dev gengetopt libpcsclite-dev
45+
46+
- name: clone the Yubico/yubihsm-shell repository
47+
uses: actions/checkout@v3
48+
with:
49+
path: yubihsm-shell
50+
51+
- name: do build
52+
working-directory: yubihsm-shell
53+
run: |
54+
cmake
55+
-DFUZZING=ON \
56+
-DWITHOUT_MANPAGES=ON \
57+
-DDISABLE_LTO=ON \
58+
-DENABLE_STATIC=ON \
59+
-B build-asan
60+
cmake --build build-asan

cmake/SecurityFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ if (CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
44
CMAKE_C_COMPILER_ID STREQUAL "AppleClang" OR
55
CMAKE_C_COMPILER_ID STREQUAL "GNU")
66

7-
add_compile_options (-Wall -Wextra -Werror)
87
add_compile_options (-Wformat -Wformat-nonliteral -Wformat-security)
98
add_compile_options (-Wshadow)
109
add_compile_options (-Wcast-qual)
@@ -13,6 +12,7 @@ if (CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
1312
add_compile_options (-pedantic -pedantic-errors)
1413
add_compile_options (-fpie -fpic)
1514
if (NOT FUZZING)
15+
add_compile_options (-Wall -Wextra -Werror)
1616
add_compile_options(-O2)
1717
add_definitions (-D_FORTIFY_SOURCE=2)
1818
endif ()

0 commit comments

Comments
 (0)