From d40a1b865fddc3d67f8c06ff1f1466fad331c8f7 Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Tue, 4 Nov 2008 15:16:23 +0000 Subject: [PATCH] Only one of these needs to be signed. --- crypto/rand/md_rand.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index cac3e8be61..48cc2e84a8 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -190,7 +190,8 @@ static void ssleay_rand_cleanup(void) static void ssleay_rand_add(const void *buf, size_t num, double add) { int i,st_idx; - ssize_t j,k; + size_t j; + ssize_t k; long md_c[2]; unsigned char local_md[MD_DIGEST_LENGTH]; EVP_MD_CTX m; @@ -303,7 +304,7 @@ static void ssleay_rand_add(const void *buf, size_t num, double add) * other thread's seeding remains without effect (except for * the incremented counter). By XORing it we keep at least as * much entropy as fits into md. */ - for (k = 0; k < (int)sizeof(md); k++) + for (k = 0; k < sizeof(md); k++) { md[k] ^= local_md[k]; } @@ -325,7 +326,8 @@ static int ssleay_rand_bytes(unsigned char *buf, size_t num) { static volatile int stirred_pool = 0; int i,st_num,st_idx; - ssize_t j,k; + size_t j; + ssize_t k; int num_ceil; int ok; long md_c[2]; @@ -492,7 +494,7 @@ static int ssleay_rand_bytes(unsigned char *buf, size_t num) } MD_Init(&m); - MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c)); + MD_Update(&m,&(md_c[0]),sizeof(md_c)); MD_Update(&m,local_md,MD_DIGEST_LENGTH); CRYPTO_w_lock(CRYPTO_LOCK_RAND); MD_Update(&m,md,MD_DIGEST_LENGTH); -- 2.25.1