#include <errno.h>
#include <time.h>
#include <stdio.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include "des_locl.h"
#include <openssl/rand.h>
const unsigned char *cp;
static int start = 1;
+ if (len < 0)
+ return -1;
+
if (outbuf == NULL) {
outbuf = OPENSSL_malloc(BSIZE + HDRSIZE);
if (outbuf == NULL)
if (len < 8) {
cp = shortbuf;
memcpy(shortbuf, buf, len);
- RAND_pseudo_bytes(shortbuf + len, 8 - len);
+ if (RAND_bytes(shortbuf + len, 8 - len) <= 0)
+ return -1;
rnum = 8;
} else {
cp = buf;