Skip to content

Commit

Permalink
Move enclave/crypto to enclave/crypto/mbedtls
Browse files Browse the repository at this point in the history
Signed-off-by: Ming-Wei Shih <[email protected]>
  • Loading branch information
mingweishih committed Oct 19, 2020
1 parent 6dd9b42 commit 561f3bf
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 43 deletions.
38 changes: 1 addition & 37 deletions enclave/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
# Copyright (c) Open Enclave SDK contributors.
# Licensed under the MIT License.

add_enclave_library(
oecryptombed
STATIC
../../common/asn1.c
../../common/cert.c
../../common/kdf.c
asn1.c
cert.c
crl.c
ctr_drbg.c
ec.c
cmac.c
hmac.c
key.c
rsa.c
sha.c)

maybe_build_using_clangw(oecryptombed)

enclave_enable_code_coverage(oecryptombed)

enclave_link_libraries(oecryptombed PUBLIC mbedcrypto)

set_enclave_property(TARGET oecryptombed PROPERTY ARCHIVE_OUTPUT_DIRECTORY
${OE_LIBDIR}/openenclave/enclave)
install_enclaves(
TARGETS
oecryptombed
EXPORT
openenclave-targets
ARCHIVE
DESTINATION
${CMAKE_INSTALL_LIBDIR}/openenclave/enclave)

if (WITH_EEID)
enclave_compile_definitions(oecryptombed PRIVATE OE_WITH_EXPERIMENTAL_EEID)
endif ()
add_subdirectory(mbedtls)
40 changes: 40 additions & 0 deletions enclave/crypto/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) Open Enclave SDK contributors.
# Licensed under the MIT License.

add_enclave_library(
oecryptombedtls
STATIC
../../../common/asn1.c
../../../common/cert.c
../../../common/kdf.c
asn1.c
cert.c
crl.c
ctr_drbg.c
ec.c
cmac.c
hmac.c
key.c
rsa.c
sha.c)

maybe_build_using_clangw(oecryptombedtls)

enclave_enable_code_coverage(oecryptombedtls)

enclave_link_libraries(oecryptombedtls PUBLIC mbedcrypto)

set_enclave_property(TARGET oecryptombedtls PROPERTY ARCHIVE_OUTPUT_DIRECTORY
${OE_LIBDIR}/openenclave/enclave)
install_enclaves(
TARGETS
oecryptombedtls
EXPORT
openenclave-targets
ARCHIVE
DESTINATION
${CMAKE_INSTALL_LIBDIR}/openenclave/enclave)

if (WITH_EEID)
enclave_compile_definitions(oecryptombedtls PRIVATE OE_WITH_EXPERIMENTAL_EEID)
endif ()
2 changes: 1 addition & 1 deletion enclave/crypto/asn1.c → enclave/crypto/mbedtls/asn1.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Open Enclave SDK contributors.
// Licensed under the MIT License.

#include "../../common/asn1.h"
#include "../../../common/asn1.h"

#include <mbedtls/asn1.h>
#include <mbedtls/oid.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions enclave/tls_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#include <stdio.h>

#include "../common/common.h"
#include "crypto/ec.h"
#include "crypto/key.h"
#include "crypto/rsa.h"

// Todo: consider set CN with enclave's MRENCLAVE values
#define SUBJECT_NAME "CN=Open Enclave SDK,O=OESDK TLS,C=US"
Expand Down
4 changes: 2 additions & 2 deletions pkgconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ set(ENCLAVE_CLIBS_1
-Wl,-gc-sections
-L\${libdir}/openenclave/enclave
-loeenclave
-loecryptombed
-loecryptombedtls
-lmbedx509
-lmbedcrypto)

Expand Down Expand Up @@ -107,7 +107,7 @@ if (LVI_MITIGATION MATCHES ControlFlow)
-Wl,-gc-sections
-L\${libdir}/openenclave/enclave
-loeenclave-lvi-cfg
-loecryptombed-lvi-cfg
-loecryptombedtls-lvi-cfg
-lmbedx509-lvi-cfg
-lmbedcrypto-lvi-cfg)

Expand Down

0 comments on commit 561f3bf

Please sign in to comment.