Merge "Fix CTS build on AOSP/master"
diff --git a/build/test_package.mk b/build/test_package.mk
index acb8121..72972b2 100644
--- a/build/test_package.mk
+++ b/build/test_package.mk
@@ -37,7 +37,7 @@
 	$(hide) mkdir -p $(CTS_TESTCASES_OUT)
 	$(hide) $(ACP) -fp $(call intermediates-dir-for,APPS,$(PRIVATE_PACKAGE))/package.apk $@
 
-$(cts_library_xml): PRIVATE_SRC_DIRS := $(cts_src_dirs)
+$(cts_package_xml): PRIVATE_SRC_DIRS := $(cts_src_dirs)
 $(cts_package_xml): PRIVATE_INSTRUMENTATION := $(LOCAL_INSTRUMENTATION_FOR)
 $(cts_package_xml): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
 ifneq ($(filter cts/suite/cts/%, $(LOCAL_PATH)),)
diff --git a/hostsidetests/security/Android.mk b/hostsidetests/security/Android.mk
index 6ff0ebf..0c976a3 100644
--- a/hostsidetests/security/Android.mk
+++ b/hostsidetests/security/Android.mk
@@ -25,7 +25,7 @@
 
 LOCAL_MODULE_CLASS := JAVA_LIBRARIES
 
-LOCAL_JAVA_LIBRARIES := cts-tradefed ddmlib-prebuilt tradefed-prebuilt
+LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt
 
 LOCAL_CTS_TEST_PACKAGE := android.host.security
 
diff --git a/tests/tests/security/tools/format_cert.sh b/tests/tests/security/tools/format_cert.sh
index 94407a0..604c1bc 100755
--- a/tests/tests/security/tools/format_cert.sh
+++ b/tests/tests/security/tools/format_cert.sh
@@ -26,16 +26,17 @@
 
 # Output file. If not specified, the file will be named <hash>.0 where "hash"
 # is the certificate's subject hash produced by:
-#   openssl x509 -in cert_file -subject_hash -noout
+#   openssl x509 -in cert_file -subject_hash_old -noout
 out_file="$2"
 
 # Detect whether the input file is PEM or DER.
+# It must use old_hash(MD5) function.
 in_form="pem"
-subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash \
+subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash_old \
     -noout 2>/dev/null)
 if [ "$?" != "0" ]; then
   in_form="der"
-  subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash \
+  subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash_old \
       -noout)
   if [ "$?" != "0" ]; then
     echo "Certificate file format is neither PEM nor DER"