aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand/md_rand.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-11-04 15:16:23 +0000
committerBen Laurie <ben@openssl.org>2008-11-04 15:16:23 +0000
commitd40a1b865fddc3d67f8c06ff1f1466fad331c8f7 (patch)
treea2ddb9a7e572f4177e372796169c1d12ebfc7dfc /crypto/rand/md_rand.c
parentf80921b6a6f1daca263e535ab21ab8f31dc25b83 (diff)
downloadopenssl-d40a1b865fddc3d67f8c06ff1f1466fad331c8f7.zip
openssl-d40a1b865fddc3d67f8c06ff1f1466fad331c8f7.tar.gz
openssl-d40a1b865fddc3d67f8c06ff1f1466fad331c8f7.tar.bz2
Only one of these needs to be signed.
Diffstat (limited to 'crypto/rand/md_rand.c')
-rw-r--r--crypto/rand/md_rand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index cac3e8b..48cc2e8 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);