Bug 1169174, Remove __DATE__ and __TIME__ references from NSS, r=rrelyea
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 09 Jul 2015 12:42:39 +0200
changeset 11492 8ea23862252b009f097807267f43248a820f673e
parent 11491 cac90b6155c9f140f63a75d38c7d7da8d2d6ca55
child 11493 6e4591303bcccc565b67d280aad752d26422da6f
push id667
push userkaie@kuix.de
push dateThu, 09 Jul 2015 10:42:56 +0000
reviewersrrelyea
bugs1169174
Bug 1169174, Remove __DATE__ and __TIME__ references from NSS, r=rrelyea
lib/ckfw/builtins/binst.c
lib/ckfw/builtins/ckbiver.c
lib/ckfw/capi/ckcapiver.c
lib/ckfw/nssmkey/ckmkver.c
lib/freebl/freeblver.c
lib/freebl/ldvector.c
lib/nss/nssinit.c
lib/nss/nssver.c
lib/smime/smimeutil.c
lib/smime/smimever.c
lib/softoken/legacydb/lginit.c
lib/softoken/pkcs11.c
lib/softoken/softkver.c
lib/ssl/sslcon.c
lib/ssl/sslver.c
lib/util/secoid.c
--- a/lib/ckfw/builtins/binst.c
+++ b/lib/ckfw/builtins/binst.c
@@ -60,21 +60,20 @@ builtins_mdInstance_GetLibraryDescriptio
 
 static CK_VERSION
 builtins_mdInstance_GetLibraryVersion
 (
   NSSCKMDInstance *mdInstance,
   NSSCKFWInstance *fwInstance
 )
 {
-  extern const char __nss_builtins_rcsid[];
-  extern const char __nss_builtins_sccsid[];
+  extern const char __nss_builtins_version[];
   volatile char c; /* force a reference that won't get optimized away */
 
-  c = __nss_builtins_rcsid[0] + __nss_builtins_sccsid[0];
+  c = __nss_builtins_version[0];
   return nss_builtins_LibraryVersion;
 }
 
 static CK_RV
 builtins_mdInstance_GetSlots
 (
   NSSCKMDInstance *mdInstance,
   NSSCKFWInstance *fwInstance,
--- a/lib/ckfw/builtins/ckbiver.c
+++ b/lib/ckfw/builtins/ckbiver.c
@@ -8,19 +8,12 @@
 
 #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.
+ * Version information
  */
-const char __nss_builtins_rcsid[] = "$Header: NSS Builtin Trusted Root CAs "
-        NSS_BUILTINS_LIBRARY_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_builtins_sccsid[] = "@(#)NSS Builtin Trusted Root CAs "
-        NSS_BUILTINS_LIBRARY_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_builtins_version[] = "Version: NSS Builtin Trusted Root CAs "
+        NSS_BUILTINS_LIBRARY_VERSION _DEBUG_STRING;
--- a/lib/ckfw/capi/ckcapiver.c
+++ b/lib/ckfw/capi/ckcapiver.c
@@ -7,19 +7,12 @@
 
 #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.
+ * Version information
  */
-const char __nss_ckcapi_rcsid[] = "$Header: NSS Access to Microsoft Certificate Store "
-        NSS_CKCAPI_LIBRARY_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_ckcapi_sccsid[] = "@(#)NSS Access to Microsoft Certificate Store "
-        NSS_CKCAPI_LIBRARY_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_ckcapi_version[] = "Version: NSS Access to Microsoft Certificate Store "
+        NSS_CKCAPI_LIBRARY_VERSION _DEBUG_STRING;
--- a/lib/ckfw/nssmkey/ckmkver.c
+++ b/lib/ckfw/nssmkey/ckmkver.c
@@ -7,19 +7,12 @@
 
 #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.
+ * Version information
  */
-const char __nss_ckmk_rcsid[] = "$Header: NSS Access to the MAC OS X Key Ring "
-        NSS_CKMK_LIBRARY_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_ckmk_sccsid[] = "@(#)NSS Access to the MAC OS X Key Ring "
-        NSS_CKMK_LIBRARY_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_ckmk_version[] = "Version: NSS Access to the MAC OS X Key Ring "
+        NSS_CKMK_LIBRARY_VERSION _DEBUG_STRING;
--- a/lib/freebl/freeblver.c
+++ b/lib/freebl/freeblver.c
@@ -8,17 +8,11 @@
 
 #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.
+ * Version information
  */
-const char __nss_freebl_rcsid[] = "$Header: NSS " SOFTOKEN_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_freebl_sccsid[] = "@(#)NSS " SOFTOKEN_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_freebl_version[] = "Version: NSS " SOFTOKEN_VERSION _DEBUG_STRING;
--- a/lib/freebl/ldvector.c
+++ b/lib/freebl/ldvector.c
@@ -289,21 +289,20 @@ static const struct FREEBLVectorStr vect
     EC_CopyParams
 
     /* End of Version 3.017 */
 };
 
 const FREEBLVector *
 FREEBL_GetVector(void)
 {
-    extern const char __nss_freebl_rcsid[];
-    extern const char __nss_freebl_sccsid[];
+    extern const char __nss_freebl_version[];
 
     /* force a reference that won't get optimized away */
     volatile char c;
 
-    c = __nss_freebl_rcsid[0] + __nss_freebl_sccsid[0];
+    c = __nss_freebl_version[0];
 #ifdef FREEBL_NO_DEPEND
     FREEBL_InitStubs();
 #endif
     return &vector;
 }
 
--- a/lib/nss/nssinit.c
+++ b/lib/nss/nssinit.c
@@ -1225,18 +1225,17 @@ NSS_ShutdownContext(NSSInitContext *cont
 
 PRBool
 NSS_IsInitialized(void)
 {
     return (nssIsInitted) || (nssInitContextList != NULL);
 }
 	
 
-extern const char __nss_base_rcsid[];
-extern const char __nss_base_sccsid[];
+extern const char __nss_base_version[];
 
 PRBool
 NSS_VersionCheck(const char *importedVersion)
 {
     /*
      * This is the secret handshake algorithm.
      *
      * This release has a simple version compatibility
@@ -1244,17 +1243,17 @@ NSS_VersionCheck(const char *importedVer
      * compatible with previous major releases.  It is
      * not compatible with future major, minor, or
      * patch releases or builds.
      */
     int vmajor = 0, vminor = 0, vpatch = 0, vbuild = 0;
     const char *ptr = importedVersion;
     volatile char c; /* force a reference that won't get optimized away */
 
-    c = __nss_base_rcsid[0] + __nss_base_sccsid[0]; 
+    c = __nss_base_version[0];
 
     while (isdigit(*ptr)) {
         vmajor = 10 * vmajor + *ptr - '0';
         ptr++;
     }
     if (*ptr == '.') {
         ptr++;
         while (isdigit(*ptr)) {
--- a/lib/nss/nssver.c
+++ b/lib/nss/nssver.c
@@ -8,17 +8,11 @@
 
 #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.
+ * Version information
  */
-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__;
+const char __nss_base_version[] = "Version: NSS " NSS_VERSION _DEBUG_STRING;
--- a/lib/smime/smimeutil.c
+++ b/lib/smime/smimeutil.c
@@ -749,34 +749,33 @@ NSS_SMIMEUtil_GetCertFromEncryptionKeyPr
 	PORT_Assert(0);
     }
 loser:
     if (tmppoolp) PORT_FreeArena(tmppoolp, PR_FALSE);
 
     return cert;
 }
 
-extern const char __nss_smime_rcsid[];
-extern const char __nss_smime_sccsid[];
+extern const char __nss_smime_version[];
 
 PRBool
 NSSSMIME_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.
      */
     volatile char c; /* force a reference that won't get optimized away */
 
-    c = __nss_smime_rcsid[0] + __nss_smime_sccsid[0]; 
+    c = __nss_smime_version[0];
 
     return NSS_VersionCheck(importedVersion);
 }
 
 const char *
 NSSSMIME_GetVersion(void)
 {
     return NSS_VERSION;
--- a/lib/smime/smimever.c
+++ b/lib/smime/smimever.c
@@ -8,17 +8,11 @@
 
 #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.
+ * Version information
  */
-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__;
+const char __nss_smime_version[] = "Version: NSS " NSS_VERSION _DEBUG_STRING;
--- a/lib/softoken/legacydb/lginit.c
+++ b/lib/softoken/legacydb/lginit.c
@@ -17,25 +17,19 @@
 
 #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.
+ * Version information
  */
-const char __nss_dbm_rcsid[] = "$Header: NSS " SOFTOKEN_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_dbm_sccsid[] = "@(#)NSS " SOFTOKEN_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_dbm_version[] = "Version: NSS " SOFTOKEN_VERSION _DEBUG_STRING;
 
 typedef struct LGPrivateStr {
     NSSLOWCERTCertDBHandle *certDB;
     NSSLOWKEYDBHandle *keyDB;
     PRLock *dbLock;
     PLHashTable *hashTable;
 } LGPrivate;
 
@@ -590,17 +584,17 @@ legacy_Open(const char *configdir, const
 	    const char *keyPrefix, int certVersion, int keyVersion,
 	    int flags, SDB **certDB, SDB **keyDB)
 {
     CK_RV crv = CKR_OK;
     SECStatus rv;
     PRBool readOnly = (flags == SDB_RDONLY)? PR_TRUE: PR_FALSE;
     volatile char c; /* force a reference that won't get optimized away */
 
-    c = __nss_dbm_rcsid[0] + __nss_dbm_sccsid[0];
+    c = __nss_dbm_version[0];
 
     rv = SECOID_Init();
     if (SECSuccess != rv) {
         return CKR_DEVICE_ERROR;
     }
     nsslowcert_InitLocks();
 
     if (keyDB) *keyDB = NULL;
--- a/lib/softoken/pkcs11.c
+++ b/lib/softoken/pkcs11.c
@@ -3130,27 +3130,26 @@ CK_RV NSC_Finalize (CK_VOID_PTR pReserve
 
     crv = nsc_CommonFinalize (pReserved, PR_FALSE);
 
     nsc_init = (PRBool) !(crv == CKR_OK);
 
     return crv;
 }
 
-extern const char __nss_softokn_rcsid[];
-extern const char __nss_softokn_sccsid[];
+extern const char __nss_softokn_version[];
 
 /* NSC_GetInfo returns general information about Cryptoki. */
 CK_RV  NSC_GetInfo(CK_INFO_PTR pInfo)
 {
     volatile char c; /* force a reference that won't get optimized away */
 
     CHECK_FORK();
     
-    c = __nss_softokn_rcsid[0] + __nss_softokn_sccsid[0]; 
+    c = __nss_softokn_version[0];
     pInfo->cryptokiVersion.major = 2;
     pInfo->cryptokiVersion.minor = 20;
     PORT_Memcpy(pInfo->manufacturerID,manufacturerID,32);
     pInfo->libraryVersion.major = SOFTOKEN_VMAJOR;
     pInfo->libraryVersion.minor = SOFTOKEN_VMINOR;
     PORT_Memcpy(pInfo->libraryDescription,libraryDescription,32);
     pInfo->flags = 0;
     return CKR_OK;
--- a/lib/softoken/softkver.c
+++ b/lib/softoken/softkver.c
@@ -8,17 +8,11 @@
 
 #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.
+ * Version information
  */
-const char __nss_softokn_rcsid[] = "$Header: NSS " SOFTOKEN_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_softokn_sccsid[] = "@(#)NSS " SOFTOKEN_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_softokn_version[] = "Version: NSS " SOFTOKEN_VERSION _DEBUG_STRING;
--- a/lib/ssl/sslcon.c
+++ b/lib/ssl/sslcon.c
@@ -3664,34 +3664,33 @@ loser:
 }
 
 /* This function doesn't really belong in this file.
 ** It's here to keep AIX compilers from optimizing it away, 
 ** and not including it in the DSO.
 */
 
 #include "nss.h"
-extern const char __nss_ssl_rcsid[];
-extern const char __nss_ssl_sccsid[];
+extern const char __nss_ssl_version[];
 
 PRBool
 NSSSSL_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.
      */
     volatile char c; /* force a reference that won't get optimized away */
 
-    c = __nss_ssl_rcsid[0] + __nss_ssl_sccsid[0]; 
+    c = __nss_ssl_version[0];
     return NSS_VersionCheck(importedVersion);
 }
 
 const char *
 NSSSSL_GetVersion(void)
 {
     return NSS_VERSION;
 }
--- a/lib/ssl/sslver.c
+++ b/lib/ssl/sslver.c
@@ -8,17 +8,11 @@
 
 #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.
+ * Version information
  */
-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__;
+const char __nss_ssl_version[] = "Version: NSS " NSS_VERSION _DEBUG_STRING;
--- a/lib/util/secoid.c
+++ b/lib/util/secoid.c
@@ -15,25 +15,19 @@
 
 #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.
+ * Version information
  */
-const char __nss_util_rcsid[] = "$Header: NSS " NSSUTIL_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__ " $";
-const char __nss_util_sccsid[] = "@(#)NSS " NSSUTIL_VERSION _DEBUG_STRING
-        "  " __DATE__ " " __TIME__;
+const char __nss_util_version[] = "Version: NSS " NSSUTIL_VERSION _DEBUG_STRING;
 
 /* MISSI Mosaic Object ID space */
 /* USGov algorithm OID space: { 2 16 840 1 101 } */
 #define USGOV                   0x60, 0x86, 0x48, 0x01, 0x65
 #define MISSI	                USGOV, 0x02, 0x01, 0x01
 #define MISSI_OLD_KEA_DSS	MISSI, 0x0c
 #define MISSI_OLD_DSS		MISSI, 0x02
 #define MISSI_KEA_DSS		MISSI, 0x14
@@ -1916,17 +1910,17 @@ SECStatus
 SECOID_Init(void)
 {
     PLHashEntry *entry;
     const SECOidData *oid;
     int i;
     char * envVal;
     volatile char c; /* force a reference that won't get optimized away */
 
-    c = __nss_util_rcsid[0] + __nss_util_sccsid[0];
+    c = __nss_util_version[0];
 
     if (oidhash) {
 	return SECSuccess; /* already initialized */
     }
 
     if (!PR_GetEnv("NSS_ALLOW_WEAK_SIGNATURE_ALG")) {
 	/* initialize any policy flags that are disabled by default */
 	xOids[SEC_OID_MD2                           ].notPolicyFlags = ~0;