aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/des/des.c
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-07-15 23:47:02 +0000
committerUlf Möller <ulf@openssl.org>1999-07-15 23:47:02 +0000
commitcfa3747ba95ed154caedf99f847082c72f867a27 (patch)
tree82d0a855a52f39a202adc4fd56bf5e3b3ece4e2f /crypto/des/des.c
parent4f6235f701587189bc159715902933e1ecedd15e (diff)
downloadopenssl-cfa3747ba95ed154caedf99f847082c72f867a27.tar.gz
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.c16
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;