Skip to content

Use generated source files from Mbed TLS #97

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

Merged
merged 3 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ set(src_crypto
ecp_curves.c
entropy.c
entropy_poll.c
error.c
gcm.c
havege.c
hkdf.c
Expand Down Expand Up @@ -65,10 +64,26 @@ set(src_crypto
sha512.c
threading.c
timing.c
xtea.c
)

# For files generated by the parent project (Mbed TLS) when building Mbed
# Crypto as a submodule, ensure that the parent project instance is used.
if(USE_CRYPTO_SUBMODULE)
set(src_crypto
${src_crypto}
${CMAKE_SOURCE_DIR}/library/version.c
${CMAKE_SOURCE_DIR}/library/version_features.c
${CMAKE_SOURCE_DIR}/library/error.c
)
else()
set(src_crypto
${src_crypto}
version.c
version_features.c
xtea.c
error.c
)
endif()

set(src_x509
certs.c
Expand Down
22 changes: 18 additions & 4 deletions library/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ OBJS_CRYPTO= aes.o aesni.o arc4.o \
dhm.o ecdh.o ecdsa.o \
ecjpake.o ecp.o \
ecp_curves.o entropy.o entropy_poll.o \
error.o gcm.o havege.o \
gcm.o havege.o \
hkdf.o \
hmac_drbg.o md.o md2.o \
md4.o md5.o md_wrap.o \
Expand All @@ -88,8 +88,22 @@ OBJS_CRYPTO= aes.o aesni.o arc4.o \
psa_its_file.o \
ripemd160.o rsa_internal.o rsa.o \
sha1.o sha256.o sha512.o \
threading.o timing.o version.o \
version_features.o xtea.o
threading.o timing.o \
xtea.o

# For files generated by the parent project (Mbed TLS) when building Mbed
# Crypto as a submodule, ensure that the parent project instance is used.
ifeq ($(USE_CRYPTO_SUBMODULE), 1)
OBJS_CRYPTO += ../../library/error.o
OBJS_CRYPTO += ../../library/version.o
OBJS_CRYPTO += ../../library/version_features.o
else
OBJS_CRYPTO += error.o
OBJS_CRYPTO += version.o
OBJS_CRYPTO += version_features.o
endif

$(info $(OBJS_CRYPTO))

OBJS_X509= certs.o pkcs11.o x509.o \
x509_create.o x509_crl.o x509_crt.o \
Expand Down Expand Up @@ -198,7 +212,7 @@ libmbedcrypto.dll: $(OBJS_CRYPTO)

.c.o:
echo " CC $<"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $<
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@

clean:
ifndef WINDOWS
Expand Down