File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,20 +13,15 @@ jobs:
1313 run : |
1414 sudo apt-get update
1515 sudo apt-get install -y build-essential
16-
17- - name : Build secure_zero conflict sample
16+
17+ - name : Build secure_zero ODR sample
1818 run : |
1919 g++ -std=c++11 -Wall -Wextra -pedantic -DHMAC_CPP_STATIC -Iinclude \
2020 tests/odr/main.cpp \
21- tests/odr/tu_memsets.cpp \
22- tests/odr/tu_manual.cpp \
23- tests/odr/stubs.cpp \
24- -o secure_zero_conflict
25-
26- - name : Expect secure_zero mismatch
27- run : |
28- if ./secure_zero_conflict; then
29- echo "secure_zero conflict binary unexpectedly succeeded"
30- exit 1
31- fi
32- echo "secure_zero conflict binary correctly reported mismatch"
21+ tests/odr/tu_memset.cpp \
22+ tests/odr/tu_explicit.cpp \
23+ tests/odr/platform_stubs.cpp \
24+ -o secure_zero_odr
25+
26+ - name : Run secure_zero ODR sample
27+ run : ./secure_zero_odr
Original file line number Diff line number Diff line change 11#include < iostream>
22
3- extern " C" int secure_zero_branch_memsets ();
4- extern " C" int secure_zero_branch_manual ();
3+ extern " C" bool secure_zero_memset_s_branch ();
4+ extern " C" bool secure_zero_explicit_bzero_branch ();
55
66int main () {
7- const auto a = secure_zero_branch_memsets ();
8- const auto b = secure_zero_branch_manual ();
9- if (a == b) {
10- std::cout << " secure_zero branch matches across TUs: " << a << " \n " ;
11- return 0 ;
12- }
7+ const bool memset_ok = secure_zero_memset_s_branch ();
8+ const bool explicit_ok = secure_zero_explicit_bzero_branch ();
139
14- std::cout << " secure_zero branch mismatch across TUs: " << a << " vs " << b << " \n " ;
15- return 1 ;
10+ if (!memset_ok || !explicit_ok) {
11+ std::cout << " secure_zero failed: memset_s=" << memset_ok
12+ << " , explicit_bzero=" << explicit_ok << " \n " ;
13+ return 1 ;
14+ }
15+
16+ std::cout << " secure_zero zeroed buffers across translation units\n " ;
17+ return 0 ;
1618}
Load diff This file was deleted.
Load diff This file was deleted.
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments