#include <stdio.h>
#include "cryptlib.h"
#include "des_locl.h"
+#include <openssl/rand.h>
/*
* WARNINGS:
des_key_schedule sched, des_cblock *iv)
{
#ifdef _LIBC
- extern int srandom();
extern unsigned long time();
- extern int random();
extern int write();
#endif
const unsigned char *buf=_buf;
if (start)
{
start=0;
- srandom(time(NULL));
}
/* lets recurse if we want to send the data in small chunks */
{
cp=shortbuf;
memcpy(shortbuf,buf,len);
- for (i=len; i<8; i++)
- shortbuf[i]=random();
+ RAND_pseudo_bytes(shortbuf+len, 8-len);
rnum=8;
}
else
{
/* eay 26/08/92 I was not doing writing from where we
* got upto. */
- i=write(fd,&(outbuf[j]),outnum-j);
+ i=write(fd,(void *)&(outbuf[j]),outnum-j);
if (i == -1)
{
+#ifdef EINTR
if (errno == EINTR)
i=0;
- else /* This is really a bad error - very bad
+ else
+#endif
+ /* This is really a bad error - very bad
* It will stuff-up both ends. */
return(-1);
}