summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Krahn <dkrahn@google.com>2016-02-03 23:15:21 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-02-03 23:15:21 +0000
commitefd8a51351b198622beffde5eca50ac63d42976e (patch)
treed532f69ac3fec5877d8b142a1588628aa4c58586
parent2ebba6b49d04880fd1f873f6c9672e70eb51dad3 (diff)
parent92af549b8048ff7816d18b335c79cac1089e24ef (diff)
downloadlibchrome-efd8a51351b198622beffde5eca50ac63d42976e.tar.gz
Add libchrome-crypto to the Makefile. am: 602804efde
am: 92af549b80 * commit '92af549b8048ff7816d18b335c79cac1089e24ef': Add libchrome-crypto to the Makefile.
-rw-r--r--Android.mk33
-rw-r--r--crypto/scoped_openssl_types.h3
-rw-r--r--crypto/secure_hash_openssl.cc1
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>