File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,23 @@ execute_process(
4949 3rdparty/mbedtls/mbedtls 3rdparty/musl/musl 3rdparty/musl/libc-test
5050 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} /3rdparty/openenclave/openenclave)
5151
52+ # mbedtls 2.28.10
53+ execute_process (
54+ COMMAND git remote add upstream https://github.com/mbed-tls/mbedtls
55+ WORKING_DIRECTORY
56+ ${CMAKE_SOURCE_DIR} /3rdparty/openenclave/openenclave/3rdparty/mbedtls/mbedtls
57+ )
58+ execute_process (
59+ COMMAND git fetch upstream 2fc8413bfcb51354c8e679141b17b3f1a5942561
60+ WORKING_DIRECTORY
61+ ${CMAKE_SOURCE_DIR} /3rdparty/openenclave/openenclave/3rdparty/mbedtls/mbedtls
62+ )
63+ execute_process (
64+ COMMAND git reset --hard 2fc8413bfcb51354c8e679141b17b3f1a5942561
65+ WORKING_DIRECTORY
66+ ${CMAKE_SOURCE_DIR} /3rdparty/openenclave/openenclave/3rdparty/mbedtls/mbedtls
67+ )
68+
5269add_subdirectory (3rdparty/openenclave)
5370add_subdirectory (docs/refman)
5471
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ add_subdirectory(memfs)
3535#add_subdirectory(mmapfs)
3636#add_subdirectory(mmapfs2)
3737#add_subdirectory(mmapfs3)
38+ add_subdirectory (mbedtls_version)
3839add_subdirectory (meshentry_go_app)
3940add_subdirectory (meshentry_nongo_app)
4041add_subdirectory (meshentry_premainmock)
Original file line number Diff line number Diff line change 1+ add_custom_command (
2+ OUTPUT test_t.c
3+ DEPENDS ../test .edl
4+ COMMAND openenclave::oeedger8r --trusted
5+ ${CMAKE_CURRENT_SOURCE_DIR} /../test .edl ${DEFINE_OE_SGX} )
6+
7+ add_enclave_library(erttest_mbedtls_version_lib OBJECT enc.cpp test_t.c)
8+ enclave_include_directories(erttest_mbedtls_version_lib PRIVATE
9+ ${CMAKE_CURRENT_BINARY_DIR} )
10+ enclave_link_libraries(erttest_mbedtls_version_lib PRIVATE oe_includes)
11+ set_property (TARGET erttest_mbedtls_version_lib
12+ PROPERTY POSITION_INDEPENDENT_CODE ON )
13+
14+ add_enclave(TARGET erttest_mbedtls_version SOURCES ../empty.c)
15+ enclave_link_libraries(erttest_mbedtls_version erttest_mbedtls_version_lib
16+ ertlibc)
17+
18+ add_test (NAME tests/ert/mbedtls_version COMMAND erttest_host
19+ erttest_mbedtls_version)
Original file line number Diff line number Diff line change 1+ #include < openenclave/internal/tests.h>
2+ #include < array>
3+ #include < cstring>
4+ #include " test_t.h"
5+
6+ extern " C" void mbedtls_version_get_string (char *);
7+
8+ using namespace std ;
9+
10+ void test_ecall ()
11+ {
12+ array<char , 9 > ver;
13+ mbedtls_version_get_string (ver.data ());
14+ OE_TEST (strcmp (ver.data (), " 2.28.10" ) == 0 );
15+ }
16+
17+ OE_SET_ENCLAVE_SGX (
18+ 1 , /* ProductID */
19+ 1 , /* SecurityVersion */
20+ true , /* Debug */
21+ 64 , /* NumHeapPages */
22+ 64 , /* NumStackPages */
23+ 1 ); /* NumTCS */
You can’t perform that action at this time.
0 commit comments