mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Only one of these needs to be signed.
This commit is contained in:
parent
f80921b6a6
commit
d40a1b865f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user