projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f80921b
)
Only one of these needs to be signed.
author
Ben Laurie
<ben@openssl.org>
Tue, 4 Nov 2008 15:16:23 +0000
(15:16 +0000)
committer
Ben Laurie
<ben@openssl.org>
Tue, 4 Nov 2008 15:16:23 +0000
(15:16 +0000)
crypto/rand/md_rand.c
patch
|
blob
|
history
diff --git
a/crypto/rand/md_rand.c
b/crypto/rand/md_rand.c
index cac3e8be61aa1b50868edc21f59ee060b933dcd6..48cc2e84a84bde86740600f1cc3504b591dcd92b 100644
(file)
--- 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;
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;
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. */
* 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];
}
{
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;
{
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];
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_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);
MD_Update(&m,local_md,MD_DIGEST_LENGTH);
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
MD_Update(&m,md,MD_DIGEST_LENGTH);