Add library version info to the NSS, S/MIME, and SSL shared libraries.
authorwtc%netscape.com
Thu, 18 Jan 2001 20:29:10 +0000
changeset 1118 41fdb9ead184961abbf949df6f4f5c71ee6fb3cd
parent 1117 aea0dd37ddbd3105d6e01699eb20520f7f4634fc
child 1119 e5ff46ead02cb5747a04a75a21f7b026fe2f5743
push idunknown
push userunknown
push dateunknown
Add library version info to the NSS, S/MIME, and SSL shared libraries. Define the NSS version macros and add NSS_VersionCheck in nss.h. Add linker option to record internal name of shared libraries. Add Windows resource files. Add rcs and sccs id strings that can be retrieved with 'ident' and 'what'. Modified Files: coreconf/HP-UX.mk coreconf/OSF1.mk coreconf/SunOS5.mk coreconf/WIN954.0.mk coreconf/WINNT4.0.mk coreconf/WINNT5.0.mk coreconf/rules.mk nss/lib/nss/config.mk nss/lib/nss/manifest.mn nss/lib/nss/nss.h nss/lib/nss/nssinit.c nss/lib/smime/config.mk nss/lib/smime/manifest.mn nss/lib/ssl/config.mk nss/lib/ssl/manifest.mn Added Files: nss/lib/nss/nss.rc nss/lib/nss/nssver.c nss/lib/smime/smime.rc nss/lib/smime/smimever.c nss/lib/ssl/ssl.rc nss/lib/ssl/sslver.c
security/coreconf/HP-UX.mk
security/coreconf/OSF1.mk
security/coreconf/SunOS5.mk
security/coreconf/WIN954.0.mk
security/coreconf/WINNT4.0.mk
security/coreconf/WINNT5.0.mk
security/coreconf/rules.mk
security/nss/lib/nss/config.mk
security/nss/lib/nss/manifest.mn
security/nss/lib/nss/nss.h
security/nss/lib/nss/nss.rc
security/nss/lib/nss/nssinit.c
security/nss/lib/nss/nssver.c
security/nss/lib/smime/config.mk
security/nss/lib/smime/manifest.mn
security/nss/lib/smime/smime.rc
security/nss/lib/smime/smimever.c
security/nss/lib/ssl/config.mk
security/nss/lib/ssl/manifest.mn
security/nss/lib/ssl/ssl.rc
security/nss/lib/ssl/sslver.c
--- a/security/coreconf/HP-UX.mk
+++ b/security/coreconf/HP-UX.mk
@@ -59,13 +59,13 @@ endif
 ifdef PTHREADS_USER
 	OS_CFLAGS	+= -D_POSIX_C_SOURCE=199506L
 endif
 
 LDFLAGS			= -z -Wl,+s
 
 MKSHLIB			= $(LD) $(DSO_LDOPTS)
 
-DSO_LDOPTS		= -b
+DSO_LDOPTS		= -b +h $(notdir $@)
 DSO_LDFLAGS		=
 
 # +Z generates position independent code for use in shared libraries.
 DSO_CFLAGS = +Z
--- a/security/coreconf/OSF1.mk
+++ b/security/coreconf/OSF1.mk
@@ -57,10 +57,10 @@ endif
 NON_LD_FLAGS += -ieee_with_inexact
 OS_CFLAGS    += -DOSF1 -D_REENTRANT 
 
 ifeq ($(USE_PTHREADS),1)
 	OS_CFLAGS += -pthread
 endif
 
 # The command to build a shared library on OSF1.
-MKSHLIB    += ld -shared -all -expect_unresolved "*"
+MKSHLIB    += ld -shared -all -expect_unresolved "*" -soname $(notdir $@)
 DSO_LDOPTS += -shared
--- a/security/coreconf/SunOS5.mk
+++ b/security/coreconf/SunOS5.mk
@@ -108,23 +108,22 @@ OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D_
 
 ifneq ($(LOCAL_THREADS_ONLY),1)
 	OS_DEFINES		+= -D_REENTRANT
 endif
 
 # Purify doesn't like -MDupdate
 NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
 
-MKSHLIB  = $(LD)
-MKSHLIB += $(DSO_LDOPTS)
+MKSHLIB  = $(LD) $(DSO_LDOPTS)
 
 # ld options:
 # -G: produce a shared object
 # -z defs: no unresolved symbols allowed
-DSO_LDOPTS += -G
+DSO_LDOPTS += -G -h $(notdir $@)
 
 # -KPIC generates position independent code for use in shared libraries.
 # (Similarly for -fPIC in case of gcc.)
 ifdef NS_USE_GCC
 	DSO_CFLAGS += -fPIC
 else
 	DSO_CFLAGS += -KPIC
 endif
--- a/security/coreconf/WIN954.0.mk
+++ b/security/coreconf/WIN954.0.mk
@@ -38,26 +38,29 @@
 # CPU_ARCH, OS_CFLAGS, and OS_DLLFLAGS.
 # PROCESSOR is an internal variable.
 
 include $(CORE_DEPTH)/coreconf/WIN32.mk
 
 PROCESSOR := $(shell uname -p)
 ifeq ($(PROCESSOR), I386)
 	CPU_ARCH   = x386
-	OS_CFLAGS += -W3 -nologo -D_X86_
+	OS_CFLAGS += -W3 -nologo
+	DEFINES += -D_X86_
 else 
 	ifeq ($(PROCESSOR), MIPS)
 		CPU_ARCH    = MIPS
-		#OS_CFLAGS += -W3 -nologo -D_MIPS_
+		#OS_CFLAGS += -W3 -nologo
+		#DEFINES += -D_MIPS_
 		OS_CFLAGS  += -W3 -nologo
 	else 
 		ifeq ($(PROCESSOR), ALPHA)
 			CPU_ARCH  = ALPHA
-			OS_CFLAGS += -W3 -nologo -D_ALPHA_=1
+			OS_CFLAGS += -W3 -nologo
+			DEFINES += -D_ALPHA_=1
 		else 
 			CPU_ARCH  = processor_is_undefined
 		endif
 	endif
 endif
 
 OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE
 DEFINES += -DWIN95
--- a/security/coreconf/WINNT4.0.mk
+++ b/security/coreconf/WINNT4.0.mk
@@ -38,32 +38,35 @@
 # CPU_ARCH, OS_CFLAGS, and OS_DLLFLAGS.
 # PROCESSOR is an internal variable.
 
 include $(CORE_DEPTH)/coreconf/WIN32.mk
 
 PROCESSOR := $(shell uname -p)
 ifeq ($(PROCESSOR), I386)
 	CPU_ARCH   = x386
-	OS_CFLAGS += -W3 -nologo -D_X86_
+	OS_CFLAGS += -W3 -nologo
+	DEFINES += -D_X86_
 else 
 	ifeq ($(PROCESSOR), MIPS)
 		CPU_ARCH  = MIPS
-		#OS_CFLAGS += -W3 -nologo -D_MIPS_
+		#OS_CFLAGS += -W3 -nologo
+		#DEFINES += -D_MIPS_
 		OS_CFLAGS += -W3 -nologo
 	else 
 		ifeq ($(PROCESSOR), ALPHA)
 			CPU_ARCH  = ALPHA
-			OS_CFLAGS += -W3 -nologo -D_ALPHA_=1
+			OS_CFLAGS += -W3 -nologo
+			DEFINES += -D_ALPHA_=1
 		else 
 			CPU_ARCH  = processor_is_undefined
 		endif
 	endif
 endif
 
 OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE
 #
 # Win NT needs -GT so that fibers can work
 #
 OS_CFLAGS += -GT
-OS_CFLAGS += -DWINNT
+DEFINES += -DWINNT
 
 NSPR31_LIB_PREFIX = lib
--- a/security/coreconf/WINNT5.0.mk
+++ b/security/coreconf/WINNT5.0.mk
@@ -38,32 +38,35 @@
 # CPU_ARCH, OS_CFLAGS, and OS_DLLFLAGS.
 # PROCESSOR is an internal variable.
 
 include $(CORE_DEPTH)/coreconf/WIN32.mk
 
 PROCESSOR := $(shell uname -p)
 ifeq ($(PROCESSOR), I386)
 	CPU_ARCH   = x386
-	OS_CFLAGS += -W3 -nologo -D_X86_
+	OS_CFLAGS += -W3 -nologo
+	DEFINES += -D_X86_
 else 
 	ifeq ($(PROCESSOR), MIPS)
 		CPU_ARCH  = MIPS
-		#OS_CFLAGS += -W3 -nologo -D_MIPS_
+		#OS_CFLAGS += -W3 -nologo
+		#DEFINES += -D_MIPS_
 		OS_CFLAGS += -W3 -nologo
 	else 
 		ifeq ($(PROCESSOR), ALPHA)
 			CPU_ARCH  = ALPHA
-			OS_CFLAGS += -W3 -nologo -D_ALPHA_=1
+			OS_CFLAGS += -W3 -nologo
+			DEFINES += -D_ALPHA_=1
 		else 
 			CPU_ARCH  = processor_is_undefined
 		endif
 	endif
 endif
 
 OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE
 #
 # Win NT needs -GT so that fibers can work
 #
 OS_CFLAGS += -GT
-OS_CFLAGS += -DWINNT
+DEFINES += -DWINNT
 
 NSPR31_LIB_PREFIX = lib
--- a/security/coreconf/rules.mk
+++ b/security/coreconf/rules.mk
@@ -357,17 +357,18 @@ endif
 endif
 ifneq ($(POLICY),)
 	-$(PLCYPATCH) $(PLCYPATCH_ARGS) $@
 endif
 
 ifeq ($(OS_ARCH), WINNT)
 $(RES): $(RESNAME)
 	@$(MAKE_OBJDIR)
-	$(RC) -Fo$(RES) $(RESNAME)
+# The resource compiler does not understand the -U option.
+	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
 	@echo $(RES) finished
 endif
 
 $(MAPFILE): $(LIBRARY_NAME).def
 ifeq ($(OS_ARCH),SunOS)
 	grep -v ';-' $(LIBRARY_NAME).def | sed -e 's,;+,,' | sed -e 's; DATA ;;' | sed -e 's,;;,,' | sed -e 's,;.*,;,' > $@
 endif
 ifeq ($(OS_ARCH),Linux)
--- a/security/nss/lib/nss/config.mk
+++ b/security/nss/lib/nss/config.mk
@@ -45,16 +45,18 @@
 # can't do this in manifest.mn because OS_ARCH isn't defined there.
 ifeq ($(OS_ARCH), WINNT)
 
 # don't want the 32 in the shared library name
 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).dll
 IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).lib
 
 DLLFLAGS += -DEF:nss.def
+RES = $(OBJDIR)/nss.res
+RESNAME = nss.rc
 
 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
 CRYPTOLIB=$(DIST)/lib/freebl.lib
 CRYPTODIR=../freebl
 ifdef MOZILLA_SECURITY_BUILD
 	CRYPTOLIB=$(DIST)/lib/crypto.lib
 	CRYPTODIR=../crypto
 endif
--- a/security/nss/lib/nss/manifest.mn
+++ b/security/nss/lib/nss/manifest.mn
@@ -35,14 +35,15 @@ CORE_DEPTH = ../../..
 EXPORTS = \
 	nss.h \
 	$(NULL)
 
 MODULE = security
 
 CSRCS = \
 	nssinit.c \
+	nssver.c \
 	$(NULL)
 
 REQUIRES = security dbm
 
 LIBRARY_NAME = nss
 LIBRARY_VERSION = 3
--- a/security/nss/lib/nss/nss.h
+++ b/security/nss/lib/nss/nss.h
@@ -36,16 +36,42 @@
  */
 
 #ifndef __nss_h_
 #define __nss_h_
 
 #include "seccomon.h"
 
 SEC_BEGIN_PROTOS
+
+/*
+ * NSS's major version, minor version, patch level, and whether
+ * this is a beta release.
+ *
+ * The format of the version string should be
+ *     "<major version>.<minor version>[.<patch level>] [<Beta>]"
+ */
+#define NSS_VERSION  "3.2 Beta"
+#define NSS_VMAJOR   3
+#define NSS_VMINOR   2
+#define NSS_VPATCH   0
+#define NSS_BETA     PR_TRUE
+
+/*
+ * Return a boolean that indicates whether the underlying library
+ * will perform as the caller expects.
+ *
+ * The only argument is a string, which should be the verson
+ * identifier of the NSS library. That string will be compared
+ * against a string that represents the actual build version of
+ * the NSS library.  It also invokes the version checking functions
+ * of the dependent libraries such as NSPR.
+ */
+extern PRBool NSS_VersionCheck(const char *importedVersion);
+
 /*
  * Open the Cert, Key, and Security Module databases, read only.
  * Initialize the Random Number Generator.
  * Does not initialize the cipher policies or enables.
  * Default policy settings disallow all ciphers.
  */
 extern SECStatus NSS_Init(const char *configdir);
 
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/nss/nss.rc
@@ -0,0 +1,98 @@
+/*
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ * 
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The Original Code is the Netscape security libraries.
+ * 
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are 
+ * Copyright (C) 2001 Netscape Communications Corporation.  All
+ * Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable 
+ * instead of those above.  If you wish to allow use of your 
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL.  If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ */
+
+#include "nss.h"
+#include <winver.h>
+
+#define MY_LIBNAME "nss"
+#define MY_FILEDESCRIPTION "NSS Base Library"
+
+#define STRINGIZE(x) #x
+#define STRINGIZE2(x) STRINGIZE(x)
+#define NSS_VMAJOR_STR STRINGIZE2(NSS_VMAJOR)
+
+#ifdef _DEBUG
+#define MY_DEBUG_STR " (debug)"
+#define MY_FILEFLAGS_1 VS_FF_DEBUG
+#else
+#define MY_DEBUG_STR ""
+#define MY_FILEFLAGS_1 0x0L
+#endif
+#if NSS_BETA
+#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
+#else
+#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
+#endif
+
+#ifdef WINNT
+#define MY_FILEOS VOS_NT_WINDOWS32
+#else
+#define MY_FILEOS VOS__WINDOWS32
+#endif
+
+#define MY_INTERNAL_NAME MY_LIBNAME NSS_VMAJOR_STR
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version-information resource
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION NSS_VMAJOR,NSS_VMINOR,NSS_VPATCH,0
+ PRODUCTVERSION NSS_VMAJOR,NSS_VMINOR,NSS_VPATCH,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS MY_FILEFLAGS_2
+ FILEOS MY_FILEOS
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L // not used
+
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0" // Lang=US English, CharSet=Unicode
+        BEGIN
+            VALUE "CompanyName", "Netscape Communications Corporation\0"
+            VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
+            VALUE "FileVersion", NSS_VERSION "\0"
+            VALUE "InternalName", MY_INTERNAL_NAME "\0"
+            VALUE "LegalCopyright", "Copyright \251 1994-2001 Netscape Communications Corporation\0"
+            VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
+            VALUE "ProductName", "Network Security Services\0"
+            VALUE "ProductVersion", NSS_VERSION "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
--- a/security/nss/lib/nss/nssinit.c
+++ b/security/nss/lib/nss/nssinit.c
@@ -30,17 +30,19 @@
  * replace them with the notice and other provisions required by
  * the GPL.  If you do not delete the provisions above, a recipient
  * may use your version of this file under either the MPL or the
  * GPL.
  *
  # $Id$
  */
 
+#include <ctype.h>
 #include "seccomon.h"
+#include "prinit.h"
 #include "prprf.h"
 #include "prmem.h"
 #include "cert.h"
 #include "key.h"
 #include "ssl.h"
 #include "sslproto.h"
 #include "secmod.h"
 #include "secmodi.h"
@@ -260,8 +262,57 @@ NSS_Shutdown(void)
     	SECKEY_CloseKeyDB(keyHandle);
 
     /* XXX
      * This should also close the secmod DB, 
      * but there's no secmod function to close the DB.
      */
 }
 
+PRBool
+NSS_VersionCheck(const char *importedVersion)
+{
+    /*
+     * This is the secret handshake algorithm.
+     *
+     * This release has a simple version compatibility
+     * check algorithm.  This release is not backward
+     * compatible with previous major releases.  It is
+     * not compatible with future major, minor, or
+     * patch releases.
+     */
+    int vmajor = 0, vminor = 0, vpatch = 0;
+    const char *ptr = importedVersion;
+
+    while (isdigit(*ptr)) {
+        vmajor = 10 * vmajor + *ptr - '0';
+        ptr++;
+    }
+    if (*ptr == '.') {
+        ptr++;
+        while (isdigit(*ptr)) {
+            vminor = 10 * vminor + *ptr - '0';
+            ptr++;
+        }
+        if (*ptr == '.') {
+            ptr++;
+            while (isdigit(*ptr)) {
+                vpatch = 10 * vpatch + *ptr - '0';
+                ptr++;
+            }
+        }
+    }
+
+    if (vmajor != NSS_VMAJOR) {
+        return PR_FALSE;
+    }
+    if (vmajor == NSS_VMAJOR && vminor > NSS_VMINOR) {
+        return PR_FALSE;
+    }
+    if (vmajor == NSS_VMAJOR && vminor == NSS_VMINOR && vpatch > NSS_VPATCH) {
+        return PR_FALSE;
+    }
+    /* Check dependent libraries */
+    if (PR_VersionCheck(PR_VERSION) == PR_FALSE) {
+        return PR_FALSE;
+    }
+    return PR_TRUE;
+}
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/nss/nssver.c
@@ -0,0 +1,53 @@
+/*
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ * 
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The Original Code is the Netscape security libraries.
+ * 
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are 
+ * Copyright (C) 2001 Netscape Communications Corporation.  All
+ * Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable 
+ * instead of those above.  If you wish to allow use of your 
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL.  If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ */
+
+/* Library identity and versioning */
+
+#include "nss.h"
+
+#if defined(DEBUG)
+#define _DEBUG_STRING " (debug)"
+#else
+#define _DEBUG_STRING ""
+#endif
+
+/*
+ * Version information for the 'ident' and 'what commands
+ *
+ * NOTE: the first component of the concatenated rcsid string
+ * must not end in a '$' to prevent rcs keyword substitution.
+ */
+const char __nss_base_rcsid[] = "$Header: NSS " NSS_VERSION _DEBUG_STRING
+        "  " __DATE__ " " __TIME__ " $";
+const char __nss_base_sccsid[] = "@(#)NSS " NSS_VERSION _DEBUG_STRING
+        "  " __DATE__ " " __TIME__;
--- a/security/nss/lib/smime/config.mk
+++ b/security/nss/lib/smime/config.mk
@@ -46,16 +46,18 @@ RELEASE_LIBS = $(TARGETS)
 
 ifeq ($(OS_ARCH), WINNT)
 
 # don't want the 32 in the shared library name
 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).dll
 IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).lib
 
 DLLFLAGS += -DEF:smime.def
+RES = $(OBJDIR)/smime.res
+RESNAME = smime.rc
 
 SHARED_LIBRARY_LIBS = \
 	$(DIST)/lib/pkcs12.lib \
 	$(DIST)/lib/pkcs7.lib \
 	$(NULL)
 
 SHARED_LIBRARY_DIRS = \
 	../pkcs12 \
--- a/security/nss/lib/smime/manifest.mn
+++ b/security/nss/lib/smime/manifest.mn
@@ -62,14 +62,15 @@ CSRCS = \
 	cmspubkey.c \
 	cmsrecinfo.c \
 	cmsreclist.c \
 	cmssigdata.c \
 	cmssiginfo.c \
 	cmsutil.c \
 	smimemessage.c \
 	smimeutil.c \
+	smimever.c \
 	$(NULL)
 
 REQUIRES = security dbm
 
 LIBRARY_NAME = smime
 LIBRARY_VERSION = 3
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/smime/smime.rc
@@ -0,0 +1,98 @@
+/*
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ * 
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The Original Code is the Netscape security libraries.
+ * 
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are 
+ * Copyright (C) 2001 Netscape Communications Corporation.  All
+ * Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable 
+ * instead of those above.  If you wish to allow use of your 
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL.  If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ */
+
+#include "nss.h"
+#include <winver.h>
+
+#define MY_LIBNAME "smime"
+#define MY_FILEDESCRIPTION "NSS S/MIME Library"
+
+#define STRINGIZE(x) #x
+#define STRINGIZE2(x) STRINGIZE(x)
+#define NSS_VMAJOR_STR STRINGIZE2(NSS_VMAJOR)
+
+#ifdef _DEBUG
+#define MY_DEBUG_STR " (debug)"
+#define MY_FILEFLAGS_1 VS_FF_DEBUG
+#else
+#define MY_DEBUG_STR ""
+#define MY_FILEFLAGS_1 0x0L
+#endif
+#if NSS_BETA
+#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
+#else
+#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
+#endif
+
+#ifdef WINNT
+#define MY_FILEOS VOS_NT_WINDOWS32
+#else
+#define MY_FILEOS VOS__WINDOWS32
+#endif
+
+#define MY_INTERNAL_NAME MY_LIBNAME NSS_VMAJOR_STR
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version-information resource
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION NSS_VMAJOR,NSS_VMINOR,NSS_VPATCH,0
+ PRODUCTVERSION NSS_VMAJOR,NSS_VMINOR,NSS_VPATCH,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS MY_FILEFLAGS_2
+ FILEOS MY_FILEOS
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L // not used
+
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0" // Lang=US English, CharSet=Unicode
+        BEGIN
+            VALUE "CompanyName", "Netscape Communications Corporation\0"
+            VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
+            VALUE "FileVersion", NSS_VERSION "\0"
+            VALUE "InternalName", MY_INTERNAL_NAME "\0"
+            VALUE "LegalCopyright", "Copyright \251 1994-2001 Netscape Communications Corporation\0"
+            VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
+            VALUE "ProductName", "Network Security Services\0"
+            VALUE "ProductVersion", NSS_VERSION "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/smime/smimever.c
@@ -0,0 +1,53 @@
+/*
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ * 
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The Original Code is the Netscape security libraries.
+ * 
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are 
+ * Copyright (C) 2001 Netscape Communications Corporation.  All
+ * Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable 
+ * instead of those above.  If you wish to allow use of your 
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL.  If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ */
+
+/* Library identity and versioning */
+
+#include "nss.h"
+
+#if defined(DEBUG)
+#define _DEBUG_STRING " (debug)"
+#else
+#define _DEBUG_STRING ""
+#endif
+
+/*
+ * Version information for the 'ident' and 'what commands
+ *
+ * NOTE: the first component of the concatenated rcsid string
+ * must not end in a '$' to prevent rcs keyword substitution.
+ */
+const char __nss_smime_rcsid[] = "$Header: NSS " NSS_VERSION _DEBUG_STRING
+        "  " __DATE__ " " __TIME__ " $";
+const char __nss_smime_sccsid[] = "@(#)NSS " NSS_VERSION _DEBUG_STRING
+        "  " __DATE__ " " __TIME__;
--- a/security/nss/lib/ssl/config.mk
+++ b/security/nss/lib/ssl/config.mk
@@ -44,16 +44,18 @@
 
 ifeq ($(OS_ARCH), WINNT)
 
 # don't want the 32 in the shared library name
 SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).dll
 IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).lib
 
 DLLFLAGS += -DEF:ssl.def
+RES = $(OBJDIR)/ssl.res
+RESNAME = ssl.rc
 
 EXTRA_SHARED_LIBS += \
 	$(DIST)/lib/nss3.lib \
 	$(DIST)/lib/$(NSPR31_LIB_PREFIX)plc4.lib \
 	$(DIST)/lib/$(NSPR31_LIB_PREFIX)plds4.lib \
 	$(DIST)/lib/$(NSPR31_LIB_PREFIX)nspr4.lib \
 	$(NULL)
 else
--- a/security/nss/lib/ssl/manifest.mn
+++ b/security/nss/lib/ssl/manifest.mn
@@ -61,16 +61,17 @@ CSRCS = \
 	sslerr.c \
 	sslgathr.c \
 	sslnonce.c \
 	sslreveal.c \
 	sslsecur.c \
 	sslsnce.c \
 	sslsock.c \
 	ssltrace.c \
+	sslver.c \
 	authcert.c \
 	cmpcert.c \
 	nsskea.c \
 	$(NULL)
 
 REQUIRES = security dbm
 
 LIBRARY_NAME = ssl
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/ssl/ssl.rc
@@ -0,0 +1,98 @@
+/*
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ * 
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The Original Code is the Netscape security libraries.
+ * 
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are 
+ * Copyright (C) 2001 Netscape Communications Corporation.  All
+ * Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable 
+ * instead of those above.  If you wish to allow use of your 
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL.  If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ */
+
+#include "nss.h"
+#include <winver.h>
+
+#define MY_LIBNAME "ssl"
+#define MY_FILEDESCRIPTION "NSS SSL Library"
+
+#define STRINGIZE(x) #x
+#define STRINGIZE2(x) STRINGIZE(x)
+#define NSS_VMAJOR_STR STRINGIZE2(NSS_VMAJOR)
+
+#ifdef _DEBUG
+#define MY_DEBUG_STR " (debug)"
+#define MY_FILEFLAGS_1 VS_FF_DEBUG
+#else
+#define MY_DEBUG_STR ""
+#define MY_FILEFLAGS_1 0x0L
+#endif
+#if NSS_BETA
+#define MY_FILEFLAGS_2 MY_FILEFLAGS_1|VS_FF_PRERELEASE
+#else
+#define MY_FILEFLAGS_2 MY_FILEFLAGS_1
+#endif
+
+#ifdef WINNT
+#define MY_FILEOS VOS_NT_WINDOWS32
+#else
+#define MY_FILEOS VOS__WINDOWS32
+#endif
+
+#define MY_INTERNAL_NAME MY_LIBNAME NSS_VMAJOR_STR
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version-information resource
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION NSS_VMAJOR,NSS_VMINOR,NSS_VPATCH,0
+ PRODUCTVERSION NSS_VMAJOR,NSS_VMINOR,NSS_VPATCH,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS MY_FILEFLAGS_2
+ FILEOS MY_FILEOS
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L // not used
+
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904B0" // Lang=US English, CharSet=Unicode
+        BEGIN
+            VALUE "CompanyName", "Netscape Communications Corporation\0"
+            VALUE "FileDescription", MY_FILEDESCRIPTION MY_DEBUG_STR "\0"
+            VALUE "FileVersion", NSS_VERSION "\0"
+            VALUE "InternalName", MY_INTERNAL_NAME "\0"
+            VALUE "LegalCopyright", "Copyright \251 1994-2001 Netscape Communications Corporation\0"
+            VALUE "OriginalFilename", MY_INTERNAL_NAME ".dll\0"
+            VALUE "ProductName", "Network Security Services\0"
+            VALUE "ProductVersion", NSS_VERSION "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
new file mode 100644
--- /dev/null
+++ b/security/nss/lib/ssl/sslver.c
@@ -0,0 +1,53 @@
+/*
+ * The contents of this file are subject to the Mozilla Public
+ * License Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ * 
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ * 
+ * The Original Code is the Netscape security libraries.
+ * 
+ * The Initial Developer of the Original Code is Netscape
+ * Communications Corporation.  Portions created by Netscape are 
+ * Copyright (C) 2001 Netscape Communications Corporation.  All
+ * Rights Reserved.
+ * 
+ * Contributor(s):
+ * 
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License Version 2 or later (the
+ * "GPL"), in which case the provisions of the GPL are applicable 
+ * instead of those above.  If you wish to allow use of your 
+ * version of this file only under the terms of the GPL and not to
+ * allow others to use your version of this file under the MPL,
+ * indicate your decision by deleting the provisions above and
+ * replace them with the notice and other provisions required by
+ * the GPL.  If you do not delete the provisions above, a recipient
+ * may use your version of this file under either the MPL or the
+ * GPL.
+ */
+
+/* Library identity and versioning */
+
+#include "nss.h"
+
+#if defined(DEBUG)
+#define _DEBUG_STRING " (debug)"
+#else
+#define _DEBUG_STRING ""
+#endif
+
+/*
+ * Version information for the 'ident' and 'what commands
+ *
+ * NOTE: the first component of the concatenated rcsid string
+ * must not end in a '$' to prevent rcs keyword substitution.
+ */
+const char __nss_ssl_rcsid[] = "$Header: NSS " NSS_VERSION _DEBUG_STRING
+        "  " __DATE__ " " __TIME__ " $";
+const char __nss_ssl_sccsid[] = "@(#)NSS " NSS_VERSION _DEBUG_STRING
+        "  " __DATE__ " " __TIME__;