Backed out changeset 71a3941348a2
authorKai Engert <kaie@kuix.de>
Mon, 19 Oct 2015 16:04:23 +0200
changeset 11680 123decc65cef8add08557f3a7be6f595e043382a
parent 11679 57b87ff765083336331456ccedeb22f5f833ec8c
child 11681 3df239b2f8e890a5c7da6c55d77a4f88f6640bd8
push id821
push userkaie@kuix.de
push dateMon, 19 Oct 2015 14:04:36 +0000
backs out71a3941348a222dbbd4ed3211fbe0d82704d9e00
Backed out changeset 71a3941348a2
coreconf/WIN32.mk
coreconf/config.mk
external_tests/ssl_gtest/Makefile
external_tests/ssl_gtest/ssl_gtest.cc
external_tests/ssl_gtest/tls_agent.cc
manifest.mn
tests/ssl_gtests/ssl_gtests.sh
--- a/coreconf/WIN32.mk
+++ b/coreconf/WIN32.mk
@@ -187,18 +187,17 @@ endif
 	# Purify requires /FIXED:NO when linking EXEs.
 	LDFLAGS    += /FIXED:NO
     endif
 ifneq ($(_MSC_VER),$(_MSC_VER_6))
     # NSS has too many of these to fix, downgrade the warning
     # Disable C4267: conversion from 'size_t' to 'type', possible loss of data
     # Disable C4244: conversion from 'type1' to 'type2', possible loss of data
     # Disable C4018: 'expression' : signed/unsigned mismatch
-    # Disable C4312: 'type cast': conversion from 'type1' to 'type2' of greater size
-    OS_CFLAGS += -w44267 -w44244 -w44018 -w44312
+    OS_CFLAGS += -w44267 -w44244 -w44018
     ifeq ($(_MSC_VER_GE_12),1)
 	OS_CFLAGS += -FS
     endif
 endif # !MSVC6
 endif # NS_USE_GCC
 
 ifdef USE_64
 DEFINES += -DWIN64
--- a/coreconf/config.mk
+++ b/coreconf/config.mk
@@ -183,12 +183,8 @@ endif
 DEFINES += -DUSE_UTIL_DIRECTLY
 USE_UTIL_DIRECTLY = 1
 
 # Build with NO_NSPR_10_SUPPORT to avoid using obsolete NSPR features
 DEFINES += -DNO_NSPR_10_SUPPORT
 
 # Hide old, deprecated, TLS cipher suite names when building NSS
 DEFINES += -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES
-
-ifdef NSS_DISABLE_GTESTS
-DIRS := $(filter-out external_tests,$(DIRS))
-endif
--- a/external_tests/ssl_gtest/Makefile
+++ b/external_tests/ssl_gtest/Makefile
@@ -38,25 +38,24 @@ include $(CORE_DEPTH)/coreconf/rules.mk
 #######################################################################
 
 
 #######################################################################
 # (7) Execute "local" rules. (OPTIONAL).                              #
 #######################################################################
 
 MKPROG = $(CCC)
+CXXFLAGS += -std=c++0x
 CFLAGS += -I$(CORE_DEPTH)/lib/ssl
 
 include ../../cmd/platrules.mk
 
 ifeq (WINNT,$(OS_ARCH))
     # -MTd (not -MD) because that makes it link to the right library
     # -EHsc because gtest has exception handlers
     OS_CFLAGS := $(filterout -MD,$(OS_CFLAGS))
     OS_CFLAGS += -MTd -EHsc -nologo
     # http://www.suodenjoki.dk/us/archive/2010/min-max.htm
     OS_CFLAGS += -DNOMINMAX
 
     # Linking to winsock to get htonl
     OS_LIBS += Ws2_32.lib
-else
-    CXXFLAGS += -std=c++0x
 endif
--- a/external_tests/ssl_gtest/ssl_gtest.cc
+++ b/external_tests/ssl_gtest/ssl_gtest.cc
@@ -11,16 +11,19 @@
 
 std::string g_working_dir_path;
 
 int main(int argc, char **argv) {
   // Start the tests
   ::testing::InitGoogleTest(&argc, argv);
   g_working_dir_path = ".";
 
+  // Temporarily disable asserts for PKCS#11 slot leakage until
+  // Bug 1168425 is fixed.
+  unsetenv("NSS_STRICT_SHUTDOWN");
   char* workdir = getenv("NSS_GTEST_WORKDIR");
   if (workdir)
     g_working_dir_path = workdir;
 
   for (int i = 0; i < argc; i++) {
     if (!strcmp(argv[i], "-d")) {
       g_working_dir_path = argv[i + 1];
       ++i;
--- a/external_tests/ssl_gtest/tls_agent.cc
+++ b/external_tests/ssl_gtest/tls_agent.cc
@@ -231,34 +231,34 @@ void TlsAgent::SetSignatureAlgorithms(co
                                       size_t count) {
   EXPECT_TRUE(EnsureTlsSetup());
   EXPECT_LE(count, SSL_SignatureMaxCount());
   EXPECT_EQ(SECSuccess, SSL_SignaturePrefSet(ssl_fd_, algorithms,
                                              static_cast<unsigned int>(count)));
   EXPECT_EQ(SECFailure, SSL_SignaturePrefSet(ssl_fd_, algorithms, 0))
       << "setting no algorithms should fail and do nothing";
 
-  std::vector<SSLSignatureAndHashAlg> configuredAlgorithms(count);
   unsigned int configuredCount;
+  SSLSignatureAndHashAlg configuredAlgorithms[count];
   EXPECT_EQ(SECFailure,
             SSL_SignaturePrefGet(ssl_fd_, nullptr, &configuredCount, 1))
       << "get algorithms, algorithms is nullptr";
   EXPECT_EQ(SECFailure,
-            SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0],
+            SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms,
                                  &configuredCount, 0))
       << "get algorithms, too little space";
   EXPECT_EQ(SECFailure,
-            SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0],
-                                 nullptr, configuredAlgorithms.size()))
+            SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms, nullptr,
+                                 PR_ARRAY_SIZE(configuredAlgorithms)))
       << "get algorithms, algCountOut is nullptr";
 
   EXPECT_EQ(SECSuccess,
-            SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0],
+            SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms,
                                  &configuredCount,
-                                 configuredAlgorithms.size()));
+                                 PR_ARRAY_SIZE(configuredAlgorithms)));
   // SignaturePrefSet drops unsupported algorithms silently, so the number that
   // are configured might be fewer.
   EXPECT_LE(configuredCount, count);
   unsigned int i = 0;
   for (unsigned int j = 0; j < count && i < configuredCount; ++j) {
     if (i < configuredCount &&
         algorithms[j].hashAlg == configuredAlgorithms[i].hashAlg &&
         algorithms[j].sigAlg == configuredAlgorithms[i].sigAlg) {
@@ -400,17 +400,17 @@ void TlsAgent::EnableExtendedMasterSecre
   SECStatus rv = SSL_OptionSet(ssl_fd_,
                                SSL_ENABLE_EXTENDED_MASTER_SECRET,
                                PR_TRUE);
 
   ASSERT_EQ(SECSuccess, rv);
 }
 
 void TlsAgent::CheckExtendedMasterSecret(bool expected) {
-  ASSERT_EQ(expected, static_cast<bool>(info_.extendedMasterSecretUsed))
+  ASSERT_EQ(expected, info_.extendedMasterSecretUsed)
       << "unexpected extended master secret state for " << name_;
 }
 
 void TlsAgent::DisableRollbackDetection() {
   ASSERT_TRUE(EnsureTlsSetup());
 
   SECStatus rv = SSL_OptionSet(ssl_fd_,
                                SSL_ROLLBACK_DETECTION,
--- a/manifest.mn
+++ b/manifest.mn
@@ -5,9 +5,13 @@
 CORE_DEPTH = .
 DEPTH      = .
 
 IMPORTS =	nspr20/v4.8 \
 		$(NULL)
 
 RELEASE = nss
 
-DIRS = coreconf lib cmd external_tests
+DIRS = coreconf lib cmd
+
+ifndef NSS_DISABLE_GTESTS
+DIRS += external_tests
+endif
--- a/tests/ssl_gtests/ssl_gtests.sh
+++ b/tests/ssl_gtests/ssl_gtests.sh
@@ -100,36 +100,26 @@ ssl_gtest_init()
 ####################################################################
 ssl_gtest_start()
 {
   if [ ! -f ${BINDIR}/ssl_gtest ]; then
     html_unknown "Skipping ssl_gtest (not built)"
     return
   fi
 
-  # Temporarily disable asserts for PKCS#11 slot leakage (Bug 1168425)
-  unset NSS_STRICT_SHUTDOWN
   SSLGTESTREPORT="${SSLGTESTDIR}/report.xml"
   ${BINDIR}/ssl_gtest -d "${SSLGTESTDIR}" --gtest_output=xml:"${SSLGTESTREPORT}"
   html_msg $? 0 "ssl_gtest run successfully"
   sed -f ${QADIR}/ssl_gtests/parsereport.sed "${SSLGTESTREPORT}" | \
   while read result name; do
     if [ "$result" = "notrun" ]; then
       echo "$name" SKIPPED
     elif [ "$result" = "run" ]; then
       html_passed "$name" > /dev/null
     else
       html_failed "$name"
     fi
   done
 }
 
-ssl_gtest_cleanup()
-{
-  cd ${QADIR}
-  . common/cleanup.sh
-}
-
 ################## main #################################################
-cd "$(dirname "$0")"
 ssl_gtest_init
 ssl_gtest_start
-ssl_gtest_cleanup