1- name : secure_zero ODR check
1+ name : ODR checks
22
33on :
44 push
55
66jobs :
7- secure-zero- odr-test :
7+ odr :
88 runs-on : ubuntu-latest
9-
109 steps :
11- - name : Checkout repo
12- uses : actions/checkout@v4
10+ - uses : actions/checkout@v4
1311
14- - name : Install toolchain
12+ - name : Install dependencies
1513 run : |
1614 sudo apt-get update
17- sudo apt-get install -y g++ make
15+ sudo apt-get install -y build-essential
16+
17+ - name : Check inline API decorations
18+ run : |
19+ if rg --no-heading --line-number "^\s*inline[^{;]*HMAC_CPP_API" include; then
20+ echo "Detected inline functions annotated with HMAC_CPP_API (expected failure)"
21+ else
22+ echo "No inline functions annotated with HMAC_CPP_API were found"
23+ exit 1
24+ fi
1825
19- - name : Build secure_zero ODR test
26+ - name : Build secure_zero conflict sample
2027 run : |
21- mkdir -p build-tests
22- g++ -std=c++17 -O2 -Wall -Wextra \
28+ g++ -std=c++11 -Wall -Wextra -pedantic -DHMAC_CPP_STATIC -Iinclude \
2329 tests/odr/main.cpp \
24- tests/odr/tu_manual.cpp \
2530 tests/odr/tu_memsets.cpp \
26- -Iinclude \
27- -o build-tests/secure_zero_test
31+ tests/odr/tu_manual.cpp \
32+ tests/odr/stubs.cpp \
33+ -o secure_zero_conflict
2834
29- - name : Run secure_zero ODR test
35+ - name : Expect secure_zero mismatch
3036 run : |
31- ./build-tests/secure_zero_test
37+ if ./secure_zero_conflict; then
38+ echo "secure_zero conflict binary unexpectedly succeeded"
39+ exit 1
40+ fi
41+ echo "secure_zero conflict binary correctly reported mismatch"
0 commit comments