summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Relyea <rrelyea@redhat.com>2016-04-11 16:30:51 +0200
committerRobert Relyea <rrelyea@redhat.com>2016-04-11 16:30:51 +0200
commita359e1196043866691b4e228c6e7604a18b2a5a4 (patch)
treec674e6aacd2226966c49ae8841ff4411d0e1a6e3
parentf702045f94902d613ef102499c1eab8ff4880a8c (diff)
downloadnss-hg-a359e1196043866691b4e228c6e7604a18b2a5a4.tar.gz
Bug 1262768, NSS 3.24 impacts Windows performance tests, r=kaieNSS_3_24_BETA5
-rw-r--r--coreconf/config.mk11
-rw-r--r--lib/freebl/fipsfreebl.c2
-rw-r--r--lib/softoken/fipstest.c2
-rw-r--r--lib/softoken/legacydb/lgfips.c4
4 files changed, 15 insertions, 4 deletions
diff --git a/coreconf/config.mk b/coreconf/config.mk
index 61d757bcc..a0b81e42c 100644
--- a/coreconf/config.mk
+++ b/coreconf/config.mk
@@ -174,6 +174,17 @@ ifdef NSS_PKIX_NO_LDAP
DEFINES += -DNSS_PKIX_NO_LDAP
endif
+# FIPS support requires startup tests to be executed at load time of shared modules.
+# For performance reasons, these tests are disabled by default.
+# When compiling binaries that must support FIPS mode,
+# you should define NSS_FORCE_FIPS
+#
+# NSS_NO_INIT_SUPPORT is always defined on platforms that don't support
+# executing the startup tests at library load time.
+ifndef NSS_FORCE_FIPS
+DEFINES += -DNSS_NO_INIT_SUPPORT
+endif
+
# Avoid building object leak test code for optimized library
ifndef BUILD_OPT
ifdef PKIX_OBJECT_LEAK_TEST
diff --git a/lib/freebl/fipsfreebl.c b/lib/freebl/fipsfreebl.c
index a4679f729..61314ba38 100644
--- a/lib/freebl/fipsfreebl.c
+++ b/lib/freebl/fipsfreebl.c
@@ -43,7 +43,7 @@ static void INIT_FUNCTION bl_startup_tests(void);
/* Windows pre-defined entry */
-#ifdef XP_WIN
+#if defined(XP_WIN) && !defined(NSS_NO_INIT_SUPPORT)
#include <windows.h>
BOOL WINAPI DllMain(
diff --git a/lib/softoken/fipstest.c b/lib/softoken/fipstest.c
index 8f9f8cc3c..fc1f0d0be 100644
--- a/lib/softoken/fipstest.c
+++ b/lib/softoken/fipstest.c
@@ -34,7 +34,7 @@
static void INIT_FUNCTION sftk_startup_tests(void);
/* Windows pre-defined entry */
-#ifdef XP_WIN
+#if defined(XP_WIN) && !defined(NSS_NO_INIT_SUPPORT)
#include <windows.h>
BOOL WINAPI DllMain(
diff --git a/lib/softoken/legacydb/lgfips.c b/lib/softoken/legacydb/lgfips.c
index 9d4bb2720..30d443b32 100644
--- a/lib/softoken/legacydb/lgfips.c
+++ b/lib/softoken/legacydb/lgfips.c
@@ -24,7 +24,7 @@
/* GCC Attribute */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(NSS_NO_INIT_SUPPORT)
#define INIT_FUNCTION __attribute__((constructor))
#else
#define INIT_FUNCTION
@@ -33,7 +33,7 @@
static void INIT_FUNCTION lg_startup_tests(void);
/* Windows pre-defined entry */
-#ifdef XP_WIN
+#if defined(XP_WIN) && !defined(NSS_NO_INIT_SUPPORT)
#include <windows.h>
BOOL WINAPI DllMain(