aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/md_rand.c6
-rw-r--r--crypto/rand/rand_egd.c2
-rw-r--r--crypto/rand/rand_unix.c10
3 files changed, 9 insertions, 9 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index 29e465b07524..a7af9f9d8671 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -238,7 +238,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
md_c[0] = md_count[0];
md_c[1] = md_count[1];
- memcpy(local_md, md, sizeof md);
+ memcpy(local_md, md, sizeof(md));
/* state_index <= state_num <= STATE_SIZE */
state_index += num;
@@ -454,7 +454,7 @@ int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
st_num = state_num;
md_c[0] = md_count[0];
md_c[1] = md_count[1];
- memcpy(local_md, md, sizeof md);
+ memcpy(local_md, md, sizeof(md));
state_index += num_ceil;
if (state_index > state_num)
@@ -480,7 +480,7 @@ int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock)
goto err;
#ifndef GETPID_IS_MEANINGLESS
if (curr_pid) { /* just in the first iteration to save time */
- if (!MD_Update(&m, (unsigned char *)&curr_pid, sizeof curr_pid))
+ if (!MD_Update(&m, (unsigned char *)&curr_pid, sizeof(curr_pid)))
goto err;
curr_pid = 0;
}
diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c
index 737aebfa22fe..66fb14c87efd 100644
--- a/crypto/rand/rand_egd.c
+++ b/crypto/rand/rand_egd.c
@@ -148,7 +148,7 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
addr.sun_family = AF_UNIX;
if (strlen(path) >= sizeof(addr.sun_path))
return (-1);
- BUF_strlcpy(addr.sun_path, path, sizeof addr.sun_path);
+ BUF_strlcpy(addr.sun_path, path, sizeof(addr.sun_path));
len = offsetof(struct sockaddr_un, sun_path) + strlen(path);
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd == -1)
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index 6c5b65da0070..097e4099181a 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -181,15 +181,15 @@ int RAND_poll(void)
*/
curr_gid = getgid();
- RAND_add(&curr_gid, sizeof curr_gid, 1);
+ RAND_add(&curr_gid, sizeof(curr_gid), 1);
curr_gid = 0;
curr_pid = getpid();
- RAND_add(&curr_pid, sizeof curr_pid, 1);
+ RAND_add(&curr_pid, sizeof(curr_pid), 1);
curr_pid = 0;
curr_uid = getuid();
- RAND_add(&curr_uid, sizeof curr_uid, 1);
+ RAND_add(&curr_uid, sizeof(curr_uid), 1);
curr_uid = 0;
for (i = 0; i < (ENTROPY_NEEDED * 4); i++) {
@@ -217,7 +217,7 @@ int RAND_poll(void)
/* take 8 bits */
v = (unsigned char)(ts.tv_nsec % 256);
- RAND_add(&v, sizeof v, 1);
+ RAND_add(&v, sizeof(v), 1);
v = 0;
}
return 1;
@@ -402,7 +402,7 @@ int RAND_poll(void)
# if defined(DEVRANDOM) || defined(DEVRANDOM_EGD)
if (n > 0) {
- RAND_add(tmpbuf, sizeof tmpbuf, (double)n);
+ RAND_add(tmpbuf, sizeof(tmpbuf), (double)n);
OPENSSL_cleanse(tmpbuf, n);
}
# endif