#define GENSALT_SETTING_SIZE 100
/* local function prototypes */
-static long read_random_bytes (void);
+static long csrand (void);
#if !USE_XCRYPT_GENSALT
static /*@observer@*/const char *gensalt (size_t salt_size);
#endif /* !USE_XCRYPT_GENSALT */
#endif /* USE_YESCRYPT */
/* Read sizeof (long) random bytes from /dev/urandom. */
-static long read_random_bytes (void)
+static long csrand (void)
{
long randval = 0;
double drand;
long ret;
- drand = (double) (read_random_bytes () & RAND_MAX) / (double) RAND_MAX;
+ drand = (double) (csrand () & RAND_MAX) / (double) RAND_MAX;
drand *= (double) (max - min + 1);
/* On systems were this is not random() range is lower, we favor
* higher numbers of salt. */
assert (salt_size >= MIN_SALT_SIZE &&
salt_size <= MAX_SALT_SIZE);
- strcat (salt, l64a (read_random_bytes ()));
+ strcat (salt, l64a (csrand ()));
do {
- strcat (salt, l64a (read_random_bytes ()));
+ strcat (salt, l64a (csrand ()));
} while (strlen (salt) < salt_size);
salt[salt_size] = '\0';