diff options
author | Ulf Möller <ulf@openssl.org> | 1999-07-16 03:47:02 +0400 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-07-16 03:47:02 +0400 |
commit | cfa3747ba95ed154caedf99f847082c72f867a27 (patch) | |
tree | 82d0a855a52f39a202adc4fd56bf5e3b3ece4e2f /crypto/des/des.c | |
parent | 4f6235f701587189bc159715902933e1ecedd15e (diff) |
More DES library cleanups: remove references to srand/rand
and delete an unused file.
Diffstat (limited to 'crypto/des/des.c')
-rw-r--r-- | crypto/des/des.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/crypto/des/des.c b/crypto/des/des.c index 32ddf1b927..b2d7f0da78 100644 --- a/crypto/des/des.c +++ b/crypto/des/des.c @@ -65,17 +65,12 @@ #else /* VMS */ #ifdef __DECC #include <unistd.h> -#if __CRTL_VER < 70000000 -#define RAND -#endif #else /* not __DECC */ #include <math.h> -#define RAND #endif /* __DECC */ #endif /* VMS */ #else #include <io.h> -#define RAND #endif #include <time.h> @@ -91,16 +86,12 @@ #include <sys/stat.h> #endif #include <openssl/des.h> +#include <openssl/rand.h> #if defined(__STDC__) || defined(VMS) || defined(M_XENIX) || defined(MSDOS) #include <string.h> #endif -#ifdef RAND -#define random rand -#define srandom(s) srand(s) -#endif - void usage(void); void doencryption(void); int uufwrite(unsigned char *data, int size, unsigned int num, FILE *fp); @@ -368,8 +359,6 @@ NULL void doencryption(void) { #ifdef _LIBC - extern int srandom(); - extern int random(); extern unsigned long time(); #endif @@ -494,9 +483,8 @@ void doencryption(void) len=l-rem; if (feof(DES_IN)) { - srandom((unsigned int)time(NULL)); for (i=7-rem; i>0; i--) - buf[l++]=random()&0xff; + RAND_bytes(buf + l++, 1); buf[l++]=rem; ex=1; len+=rem; |