-
-
Notifications
You must be signed in to change notification settings - Fork 0
201 lines (180 loc) · 7.1 KB
/
Copy pathfuzzing.yml
File metadata and controls
201 lines (180 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: CI - Fuzzing (libFuzzer)
on:
push:
branches: [ main, develop, 'feature/**', 'fix/**' ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
inputs:
fuzz_duration:
description: 'Fuzzing duration per target (seconds)'
required: false
default: '60'
permissions:
contents: read
# Collapse overlapping runs on the same ref so rapid pushes don't
# saturate the runner queue (libFuzzer builds plus 11 matrix targets
# per trigger × 2 triggers = 22+ concurrent jobs per push). Feature
# branches and PR heads cancel previous in-flight runs; main and
# scheduled runs are preserved.
concurrency:
group: fuzzing-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.event_name != 'schedule' }}
jobs:
fuzz-core:
name: Fuzz Core Primitives (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
target:
- fuzz_sha3
- fuzz_ed25519
- fuzz_aes_gcm
- fuzz_hkdf
- fuzz_consttime
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install dependencies
run: |
# Remove non-essential third-party apt repos that may cause 403 errors on runners
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list || true
sudo apt-get update
sudo apt-get install -y cmake clang libclang-rt-dev
- name: Build fuzz targets
run: |
cmake -B build-fuzz \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_BUILD_TYPE=Debug \
-DAMA_BUILD_FUZZ=ON \
-DAMA_BUILD_TESTS=OFF \
-DAMA_BUILD_EXAMPLES=OFF \
-DAMA_ENABLE_LTO=OFF \
-DAMA_USE_NATIVE_PQC=ON
cmake --build build-fuzz --target ${{ matrix.target }} -j$(nproc)
- name: Run fuzzer (${{ matrix.target }})
env:
FUZZ_DURATION: ${{ github.event.inputs.fuzz_duration || '60' }}
run: |
mkdir -p corpus/${{ matrix.target }}
mkdir -p artifacts/${{ matrix.target }}
echo "Fuzzing ${{ matrix.target }} for ${FUZZ_DURATION}s..."
./build-fuzz/bin/${{ matrix.target }} \
-max_total_time=${FUZZ_DURATION} \
-max_len=4096 \
-artifact_prefix=artifacts/${{ matrix.target }}/ \
corpus/${{ matrix.target }}/
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fuzz-crashes-${{ matrix.target }}
path: artifacts/${{ matrix.target }}/
retention-days: 30
fuzz-pqc:
name: Fuzz PQC Primitives (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
target:
- fuzz_dilithium
- fuzz_kyber
- fuzz_chacha20poly1305
- fuzz_x25519
- fuzz_argon2
- fuzz_secp256k1
- fuzz_frost
# SPHINCS+ is too slow for CI fuzzing — run manually
# - fuzz_sphincs
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install dependencies
run: |
# Remove non-essential third-party apt repos that may cause 403 errors on runners
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list || true
sudo apt-get update
sudo apt-get install -y cmake clang libclang-rt-dev
- name: Build fuzz targets
run: |
cmake -B build-fuzz \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_BUILD_TYPE=Debug \
-DAMA_BUILD_FUZZ=ON \
-DAMA_BUILD_TESTS=OFF \
-DAMA_BUILD_EXAMPLES=OFF \
-DAMA_ENABLE_LTO=OFF \
-DAMA_USE_NATIVE_PQC=ON
cmake --build build-fuzz --target ${{ matrix.target }} -j$(nproc)
- name: Run fuzzer (${{ matrix.target }})
env:
FUZZ_DURATION: ${{ github.event.inputs.fuzz_duration || '60' }}
run: |
mkdir -p corpus/${{ matrix.target }}
mkdir -p artifacts/${{ matrix.target }}
echo "Fuzzing ${{ matrix.target }} for ${FUZZ_DURATION}s..."
./build-fuzz/bin/${{ matrix.target }} \
-max_total_time=${FUZZ_DURATION} \
-max_len=4096 \
-artifact_prefix=artifacts/${{ matrix.target }}/ \
corpus/${{ matrix.target }}/
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fuzz-crashes-${{ matrix.target }}
path: artifacts/${{ matrix.target }}/
retention-days: 30
fuzz-consttime-aes:
name: Fuzz AES-GCM (constant-time bitsliced backend)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install dependencies
run: |
# Remove non-essential third-party apt repos that may cause 403 errors on runners
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list || true
sudo apt-get update
sudo apt-get install -y cmake clang libclang-rt-dev
- name: Build with constant-time AES
run: |
cmake -B build-fuzz-ct \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_BUILD_TYPE=Debug \
-DAMA_BUILD_FUZZ=ON \
-DAMA_BUILD_TESTS=OFF \
-DAMA_BUILD_EXAMPLES=OFF \
-DAMA_ENABLE_LTO=OFF \
-DAMA_AES_CONSTTIME=ON \
-DAMA_USE_NATIVE_PQC=ON
cmake --build build-fuzz-ct --target fuzz_aes_gcm -j$(nproc)
- name: Run AES-GCM fuzzer (consttime backend)
run: |
mkdir -p corpus/fuzz_aes_gcm_ct
mkdir -p artifacts/fuzz_aes_gcm_ct
./build-fuzz-ct/bin/fuzz_aes_gcm \
-max_total_time=30 \
-max_len=4096 \
-artifact_prefix=artifacts/fuzz_aes_gcm_ct/ \
corpus/fuzz_aes_gcm_ct/
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: fuzz-crashes-aes-gcm-consttime
path: artifacts/fuzz_aes_gcm_ct/
retention-days: 30
# Constant-time verification of the legacy tools/constant_time/ harnesses
# lives in .github/workflows/dudect.yml :: dudect-legacy-harnesses. That
# job runs the same `dudect_harness 50000` and `dudect_crypto 50000`
# invocations under `taskset -c 0 nice -n -10` (single-core pinning +
# elevated priority) and `cmake --build -j$(nproc)`, both of which the
# earlier in-file `constant-time-crypto` job lacked. Keeping a second,
# un-pinned copy here only multiplied flake exposure on contended
# runners without adding coverage.