-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fuzz/*: fuzz rats-tls APIs in sgx mode #184
base: master
Are you sure you want to change the base?
Conversation
673d835
to
f13edd0
Compare
83bc27e
to
897b012
Compare
1f27728
to
3fbcf16
Compare
set(SGX_COMMON_CXXFLAGS "${SGX_COMMON_FLAGS} -Wnon-virtual-dtor -std=c++11") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -fPIC -Werror=implicit-function-declaration") | ||
endif() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if((BUILD_FUZZ) AND (SGX))
string(REPLACE "-std=gnu11" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "-std=c11" "" SGX_COMMON_FLAGS "${SGX_COMMON_FLAGS}")
string(REPLACE "-std=c++11" "" SGX_COMMON_CXXFLAGS "${SGX_COMMON_CXXFLAGS}")
fuzz/tls_sgx_mode/fuzz_sgx_mode.cc
Outdated
char verifier_types[10][25] = { "nullverifier", "", "sgx_la", | ||
"csv", "sev", "sev_snp", | ||
"tdx_ecdsa", "tdx_ecdsa", "sgx_ecdsa_qve" }; | ||
strcpy(verifier_types[9], fuzzed_data.ConsumeBytesWithTerminator(20, '\0').data()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not use verifier_types in the following code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I just comment this line 95-98 ?
fuzz/tls_sgx_mode/fuzz_sgx_mode.cc
Outdated
uint16_t s_port = htons((uint16_t)FUZZ_PORT); | ||
|
||
char * attester_type = (char *)malloc(20); | ||
if(attester_type == NULL){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char * attester_type to char *attester_type . please check the other code
use libfuzzer to fuzz rats-tls API `rats_tls_init()`, `rats_tls_negotiate()`, `rats_tls_transmit()`, `rats_tls_receive()`, `rats_tls_cleanup()` in sgx mode. Signed-off-by: Pengyu Chen <[email protected]>
@@ -58,6 +62,11 @@ if(SGX) | |||
|
|||
set(SGX_COMMON_CFLAGS "${SGX_COMMON_FLAGS} -Wstrict-prototypes -Wunsuffixed-float-constants -Wno-implicit-function-declaration -std=c11") | |||
set(SGX_COMMON_CXXFLAGS "${SGX_COMMON_FLAGS} -Wnon-virtual-dtor -std=c++11") | |||
if((BUILD_FUZZ) AND (SGX)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove AND (SGX)
,since if(SGX)
is in line 21,
@@ -12,6 +12,10 @@ else() | |||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") | |||
endif() | |||
|
|||
if((BUILD_FUZZ) AND (SGX)) | |||
string(REPLACE "-std=gnu11" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") | |||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this code to line 65
cf1d777
to
2f6f25f
Compare
9898753
to
fb8ba10
Compare
use libfuzzer to fuzz rats-tls API
rats_tls_init()
,rats_tls_negotiate()
,rats_tls_transmit()
andrats_tls_receive()
in sgx mode