diff options
author | Darren Krahn <dkrahn@google.com> | 2015-12-11 16:59:38 -0800 |
---|---|---|
committer | Darren Krahn <dkrahn@google.com> | 2016-02-03 23:05:56 +0000 |
commit | 602804efded144af970140446c5010aeacd5c4a5 (patch) | |
tree | d532f69ac3fec5877d8b142a1588628aa4c58586 | |
parent | 933451c3ff475cafa8d35b63d921334023b7de3b (diff) | |
download | libchrome-602804efded144af970140446c5010aeacd5c4a5.tar.gz |
Add libchrome-crypto to the Makefile.
Also add minor fixes to get the build working with boringssl.
BUG=25746269
Change-Id: I4af9850a48a813c1310d7eb7596f7ef79812a57e
-rw-r--r-- | Android.mk | 33 | ||||
-rw-r--r-- | crypto/scoped_openssl_types.h | 3 | ||||
-rw-r--r-- | crypto/secure_hash_openssl.cc | 1 |
3 files changed, 34 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk index 6828b6c386..3f8ebbac96 100644 --- a/Android.mk +++ b/Android.mk @@ -377,6 +377,10 @@ libchromeCommonUnittestSrc := \ testing/multiprocess_func_list.cc \ testrunner.cc \ +libchromeCryptoUnittestSrc := \ + crypto/secure_hash_unittest.cc \ + crypto/sha2_unittest.cc \ + libchromeHostCFlags := -D__ANDROID_HOST__ ifeq ($(HOST_OS),linux) @@ -445,7 +449,6 @@ LOCAL_SRC_FILES := \ dbus/values_util.cc \ LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension) -# webservd uses RTTI, so that this library also needs to be built with it. LOCAL_CFLAGS := $(libchromeCommonCFlags) LOCAL_CLANG := $(libchromeUseClang) LOCAL_C_INCLUDES := $(libchromeCommonCIncludes) @@ -460,6 +463,30 @@ include $(BUILD_SHARED_LIBRARY) endif # local_use_dbus == 1 +# libchrome-crypto shared library for target +# ======================================================== +include $(CLEAR_VARS) +LOCAL_MODULE := libchrome-crypto +LOCAL_SRC_FILES := \ + crypto/openssl_util.cc \ + crypto/secure_hash_openssl.cc \ + crypto/secure_util.cc \ + crypto/sha2.cc \ + +LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension) +LOCAL_CFLAGS := $(libchromeCommonCFlags) -Wno-unused-parameter +LOCAL_CPPFLAGS := $(libchromeCommonCppFlags) +LOCAL_CLANG := $(libchromeUseClang) +LOCAL_C_INCLUDES := $(libchromeCommonCIncludes) +LOCAL_SHARED_LIBRARIES := \ + libchrome \ + libcrypto \ + libssl \ + +LOCAL_STATIC_LIBRARIES := +LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes) +include $(BUILD_SHARED_LIBRARY) + # Helpers needed for unit tests. # ======================================================== include $(CLEAR_VARS) @@ -540,11 +567,11 @@ LOCAL_MODULE := libchrome_test ifdef BRILLO LOCAL_MODULE_TAGS := debug endif -LOCAL_SRC_FILES := $(libchromeCommonUnittestSrc) +LOCAL_SRC_FILES := $(libchromeCryptoUnittestSrc) $(libchromeCommonUnittestSrc) LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension) LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags) -DUNIT_TEST -DDONT_EMBED_BUILD_METADATA LOCAL_CLANG := $(libchromeUseClang) LOCAL_C_INCLUDES := $(libchromeCommonCIncludes) -LOCAL_SHARED_LIBRARIES := libchrome libevent +LOCAL_SHARED_LIBRARIES := libchrome libchrome-crypto libevent LOCAL_STATIC_LIBRARIES := libgmock libgtest include $(BUILD_NATIVE_TEST) diff --git a/crypto/scoped_openssl_types.h b/crypto/scoped_openssl_types.h index e7b27deeae..33b618d1a3 100644 --- a/crypto/scoped_openssl_types.h +++ b/crypto/scoped_openssl_types.h @@ -11,6 +11,9 @@ #include <openssl/ec.h> #include <openssl/ecdsa.h> #include <openssl/evp.h> +#ifdef OPENSSL_IS_BORINGSSL +#include <openssl/mem.h> +#endif #include <openssl/rsa.h> #include <stdint.h> diff --git a/crypto/secure_hash_openssl.cc b/crypto/secure_hash_openssl.cc index 6fede29d99..ec859ff108 100644 --- a/crypto/secure_hash_openssl.cc +++ b/crypto/secure_hash_openssl.cc @@ -4,6 +4,7 @@ #include "crypto/secure_hash.h" +#include <openssl/mem.h> #include <openssl/sha.h> #include <stddef.h> |