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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -629,44 +629,6 @@ GiveSystemInfo(void)
|
||||
}
|
||||
#endif /* sinix */
|
||||
|
||||
#if defined(VMS)
|
||||
#include <c_asm.h>
|
||||
|
||||
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 <be/kernel/OS.h>
|
||||
@@ -880,9 +842,6 @@ safe_pclose(FILE *fp)
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
#if !defined(VMS)
|
||||
|
||||
#ifdef DARWIN
|
||||
#include <crt_externs.h>
|
||||
#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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user