From 95af4c94213f8b32cc7469b093f2d1a84d11f3ac Mon Sep 17 00:00:00 2001 From: "nelson%bolyard.com" Date: Wed, 10 Jun 2009 00:42:17 +0000 Subject: [PATCH] Bug 491044: Remove support for VMS (a.k.a., OpenVMS) from NSS, r=rrelyea git-svn-id: svn://10.0.0.236/trunk@257452 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dbm/src/hash.c | 2 +- mozilla/security/nss/lib/freebl/unix_rand.c | 100 -------------------- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/mozilla/dbm/src/hash.c b/mozilla/dbm/src/hash.c index e98aa430144..c7b1d18133c 100644 --- a/mozilla/dbm/src/hash.c +++ b/mozilla/dbm/src/hash.c @@ -339,7 +339,7 @@ init_hash(HTAB *hashp, const char *file, HASHINFO *info) if (stat(file, &statbuf)) return (NULL); -#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(VMS) && !defined(XP_OS2) +#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2) #if defined(__QNX__) && !defined(__QNXNTO__) hashp->BSIZE = 512; /* preferred blk size on qnx4 */ #else diff --git a/mozilla/security/nss/lib/freebl/unix_rand.c b/mozilla/security/nss/lib/freebl/unix_rand.c index 28b523759e2..c8344b9b31b 100644 --- a/mozilla/security/nss/lib/freebl/unix_rand.c +++ b/mozilla/security/nss/lib/freebl/unix_rand.c @@ -629,44 +629,6 @@ GiveSystemInfo(void) } #endif /* sinix */ -#if defined(VMS) -#include - -static void -GiveSystemInfo(void) -{ - long si; - - /* - * This is copied from the SCO/UNIXWARE etc section. And like the comment - * there says, what's the point? This isn't random, it generates the same - * stuff every time its run! - */ - si = sysconf(_SC_CHILD_MAX); - RNG_RandomUpdate(&si, sizeof(si)); - - si = sysconf(_SC_STREAM_MAX); - RNG_RandomUpdate(&si, sizeof(si)); - - si = sysconf(_SC_OPEN_MAX); - RNG_RandomUpdate(&si, sizeof(si)); -} - -/* - * Use the "get the cycle counter" instruction on the alpha. - * The low 32 bits completely turn over in less than a minute. - * The high 32 bits are some non-counter gunk that changes sometimes. - */ -static size_t -GetHighResClock(void *buf, size_t maxbytes) -{ - unsigned long t; - - t = asm("rpcc %v0"); - return CopyLowBits(buf, maxbytes, &t, sizeof(t)); -} - -#endif /* VMS */ #ifdef BEOS #include @@ -880,9 +842,6 @@ safe_pclose(FILE *fp) return status; } - -#if !defined(VMS) - #ifdef DARWIN #include #endif @@ -1023,65 +982,6 @@ void RNG_SystemInfoForRNG(void) #endif } -#else -void RNG_SystemInfoForRNG(void) -{ - FILE *fp; - char buf[BUFSIZ]; - size_t bytes; - int extra; - char **cp; - extern char **environ; - char *randfile; - - GiveSystemInfo(); - - bytes = RNG_GetNoise(buf, sizeof(buf)); - RNG_RandomUpdate(buf, bytes); - - /* - * Pass the C environment and the addresses of the pointers to the - * hash function. This makes the random number function depend on the - * execution environment of the user and on the platform the program - * is running on. - */ - cp = environ; - while (*cp) { - RNG_RandomUpdate(*cp, strlen(*cp)); - cp++; - } - RNG_RandomUpdate(environ, (char*)cp - (char*)environ); - - /* Give in system information */ - if (gethostname(buf, sizeof(buf)) > 0) { - RNG_RandomUpdate(buf, strlen(buf)); - } - GiveSystemInfo(); - - /* If the user points us to a random file, pass it through the rng */ - randfile = getenv("NSRANDFILE"); - if ( ( randfile != NULL ) && ( randfile[0] != '\0') ) { - RNG_FileForRNG(randfile); - } - - /* - ** We need to generate at least 1024 bytes of seed data. Since we don't - ** do the file stuff for VMS, and because the environ list is so short - ** on VMS, we need to make sure we generate enough. So do another 1000 - ** bytes to be sure. - */ - extra = 1000; - while (extra > 0) { - cp = environ; - while (*cp) { - int n = strlen(*cp); - RNG_RandomUpdate(*cp, n); - extra -= n; - cp++; - } - } -} -#endif #define TOTAL_FILE_LIMIT 1000000 /* one million */