diff options
-rw-r--r-- | coreconf/WIN32.mk | 3 | ||||
-rw-r--r-- | coreconf/config.mk | 4 | ||||
-rw-r--r-- | external_tests/ssl_gtest/Makefile | 3 | ||||
-rw-r--r-- | external_tests/ssl_gtest/ssl_gtest.cc | 3 | ||||
-rw-r--r-- | external_tests/ssl_gtest/tls_agent.cc | 14 | ||||
-rw-r--r-- | manifest.mn | 6 | ||||
-rwxr-xr-x | tests/ssl_gtests/ssl_gtests.sh | 10 |
7 files changed, 26 insertions, 17 deletions
diff --git a/coreconf/WIN32.mk b/coreconf/WIN32.mk index b8f8f48c4..ad5858ff6 100644 --- a/coreconf/WIN32.mk +++ b/coreconf/WIN32.mk @@ -192,7 +192,8 @@ ifneq ($(_MSC_VER),$(_MSC_VER_6)) # 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 - OS_CFLAGS += -w44267 -w44244 -w44018 + # Disable C4312: 'type cast': conversion from 'type1' to 'type2' of greater size + OS_CFLAGS += -w44267 -w44244 -w44018 -w44312 ifeq ($(_MSC_VER_GE_12),1) OS_CFLAGS += -FS endif diff --git a/coreconf/config.mk b/coreconf/config.mk index 99c6ce6c1..a7de0ec4f 100644 --- a/coreconf/config.mk +++ b/coreconf/config.mk @@ -188,3 +188,7 @@ 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 diff --git a/external_tests/ssl_gtest/Makefile b/external_tests/ssl_gtest/Makefile index 7f36bffe4..7a2f354f0 100644 --- a/external_tests/ssl_gtest/Makefile +++ b/external_tests/ssl_gtest/Makefile @@ -43,7 +43,6 @@ include $(CORE_DEPTH)/coreconf/rules.mk ####################################################################### MKPROG = $(CCC) -CXXFLAGS += -std=c++0x CFLAGS += -I$(CORE_DEPTH)/lib/ssl include ../../cmd/platrules.mk @@ -58,4 +57,6 @@ ifeq (WINNT,$(OS_ARCH)) # Linking to winsock to get htonl OS_LIBS += Ws2_32.lib +else + CXXFLAGS += -std=c++0x endif diff --git a/external_tests/ssl_gtest/ssl_gtest.cc b/external_tests/ssl_gtest/ssl_gtest.cc index 938b013af..ee1c40cfd 100644 --- a/external_tests/ssl_gtest/ssl_gtest.cc +++ b/external_tests/ssl_gtest/ssl_gtest.cc @@ -16,9 +16,6 @@ int main(int argc, char **argv) { ::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; diff --git a/external_tests/ssl_gtest/tls_agent.cc b/external_tests/ssl_gtest/tls_agent.cc index 16a39329d..bb82a8daa 100644 --- a/external_tests/ssl_gtest/tls_agent.cc +++ b/external_tests/ssl_gtest/tls_agent.cc @@ -236,24 +236,24 @@ void TlsAgent::SetSignatureAlgorithms(const SSLSignatureAndHashAlg* algorithms, 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, + SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0], &configuredCount, 0)) << "get algorithms, too little space"; EXPECT_EQ(SECFailure, - SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms, nullptr, - PR_ARRAY_SIZE(configuredAlgorithms))) + SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0], + nullptr, configuredAlgorithms.size())) << "get algorithms, algCountOut is nullptr"; EXPECT_EQ(SECSuccess, - SSL_SignaturePrefGet(ssl_fd_, configuredAlgorithms, + SSL_SignaturePrefGet(ssl_fd_, &configuredAlgorithms[0], &configuredCount, - PR_ARRAY_SIZE(configuredAlgorithms))); + configuredAlgorithms.size())); // SignaturePrefSet drops unsupported algorithms silently, so the number that // are configured might be fewer. EXPECT_LE(configuredCount, count); @@ -405,7 +405,7 @@ void TlsAgent::EnableExtendedMasterSecret() { } void TlsAgent::CheckExtendedMasterSecret(bool expected) { - ASSERT_EQ(expected, info_.extendedMasterSecretUsed) + ASSERT_EQ(expected, static_cast<bool>(info_.extendedMasterSecretUsed)) << "unexpected extended master secret state for " << name_; } diff --git a/manifest.mn b/manifest.mn index 8a25f8277..cb2470bf4 100644 --- a/manifest.mn +++ b/manifest.mn @@ -10,8 +10,4 @@ IMPORTS = nspr20/v4.8 \ RELEASE = nss -DIRS = coreconf lib cmd - -ifndef NSS_DISABLE_GTESTS -DIRS += external_tests -endif +DIRS = coreconf lib cmd external_tests diff --git a/tests/ssl_gtests/ssl_gtests.sh b/tests/ssl_gtests/ssl_gtests.sh index ad3d4448d..f57ef95ee 100755 --- a/tests/ssl_gtests/ssl_gtests.sh +++ b/tests/ssl_gtests/ssl_gtests.sh @@ -105,6 +105,8 @@ ssl_gtest_start() 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" @@ -120,6 +122,14 @@ ssl_gtest_start() done } +ssl_gtest_cleanup() +{ + cd ${QADIR} + . common/cleanup.sh +} + ################## main ################################################# +cd "$(dirname "$0")" ssl_gtest_init ssl_gtest_start +ssl_gtest_cleanup |