summaryrefslogtreecommitdiffstats
path: root/crypto/rand/md_rand.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-06-20 00:30:40 +0200
committerDr. Stephen Henson <steve@openssl.org>2001-06-20 00:30:40 +0200
commit323f289c480b0a8eb15ed3be2befbcc0f86e8904 (patch)
treea8f18dde28ce3c77b7bff50c2b45a44c556dfed4 /crypto/rand/md_rand.c
parentFix memory leaks. (diff)
downloadopenssl-323f289c480b0a8eb15ed3be2befbcc0f86e8904.tar.xz
openssl-323f289c480b0a8eb15ed3be2befbcc0f86e8904.zip
Change all calls to low level digest routines in the library and
applications to use EVP. Add missing calls to HMAC_cleanup() and don't assume HMAC_CTX can be copied using memcpy(). Note: this is almost identical to the patch submitted to openssl-dev by Verdon Walker <VWalker@novell.com> except some redundant EVP_add_digest_()/EVP_cleanup() calls were removed and some changes made to avoid compiler warnings.
Diffstat (limited to 'crypto/rand/md_rand.c')
-rw-r--r--crypto/rand/md_rand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index d4d2f36ad4..1c87f21171 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -264,7 +264,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
MD_Update(&m,buf,j);
MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c));
- MD_Final(local_md,&m);
+ MD_Final(&m,local_md);
md_c[1]++;
buf=(const char *)buf + j;
@@ -457,7 +457,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
}
else
MD_Update(&m,&(state[st_idx]),j);
- MD_Final(local_md,&m);
+ MD_Final(&m,local_md);
for (i=0; i<j; i++)
{
@@ -473,7 +473,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
MD_Update(&m,local_md,MD_DIGEST_LENGTH);
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
MD_Update(&m,md,MD_DIGEST_LENGTH);
- MD_Final(md,&m);
+ MD_Final(&m,md);
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
memset(&m,0,sizeof(m));