aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-10-16 01:24:29 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-10-16 01:24:29 +0000
commit20d2186c87dabec56c6da48961a779843724a019 (patch)
tree4c5c2ba2e12a851c48726b6e5cc83a006f8291f1 /apps
parent9ba3ec91766e559f96248fe10c77551a4e017ec3 (diff)
downloadopenssl-20d2186c87dabec56c6da48961a779843724a019.tar.gz
Retain compatibility of EVP_DigestInit() and EVP_DigestFinal()
with existing code. Modify library to use digest *_ex() functions.
Diffstat (limited to 'apps')
-rw-r--r--apps/passwd.c12
-rw-r--r--apps/speed.c13
2 files changed, 13 insertions, 12 deletions
diff --git a/apps/passwd.c b/apps/passwd.c
index 0641602d04..bb395c35a1 100644
--- a/apps/passwd.c
+++ b/apps/passwd.c
@@ -327,7 +327,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
assert(salt_len <= 8);
EVP_MD_CTX_init(&md);
- EVP_DigestInit(&md,EVP_md5());
+ EVP_DigestInit_ex(&md,EVP_md5(), NULL);
EVP_DigestUpdate(&md, passwd, passwd_len);
EVP_DigestUpdate(&md, "$", 1);
EVP_DigestUpdate(&md, magic, strlen(magic));
@@ -335,11 +335,11 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
EVP_DigestUpdate(&md, salt_out, salt_len);
EVP_MD_CTX_init(&md2);
- EVP_DigestInit(&md2,EVP_md5());
+ EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
EVP_DigestUpdate(&md2, passwd, passwd_len);
EVP_DigestUpdate(&md2, salt_out, salt_len);
EVP_DigestUpdate(&md2, passwd, passwd_len);
- EVP_DigestFinal(&md2, buf, NULL);
+ EVP_DigestFinal_ex(&md2, buf, NULL);
for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
EVP_DigestUpdate(&md, buf, sizeof buf);
@@ -351,11 +351,11 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
EVP_DigestUpdate(&md, (n & 1) ? "\0" : passwd, 1);
n >>= 1;
}
- EVP_DigestFinal(&md, buf, NULL);
+ EVP_DigestFinal_ex(&md, buf, NULL);
for (i = 0; i < 1000; i++)
{
- EVP_DigestInit(&md2,EVP_md5());
+ EVP_DigestInit_ex(&md2,EVP_md5(), NULL);
EVP_DigestUpdate(&md2, (i & 1) ? (unsigned char *) passwd : buf,
(i & 1) ? passwd_len : sizeof buf);
if (i % 3)
@@ -364,7 +364,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
EVP_DigestUpdate(&md2, passwd, passwd_len);
EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned char *) passwd,
(i & 1) ? sizeof buf : passwd_len);
- EVP_DigestFinal(&md2, buf, NULL);
+ EVP_DigestFinal_ex(&md2, buf, NULL);
}
EVP_MD_CTX_cleanup(&md2);
diff --git a/apps/speed.c b/apps/speed.c
index aeb2fa7fd7..3c359e3d6b 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -944,7 +944,7 @@ int MAIN(int argc, char **argv)
print_message(names[D_MD2],c[D_MD2][j],lengths[j]);
Time_F(START,usertime);
for (count=0,run=1; COND(c[D_MD2][j]); count++)
- EVP_Digest(buf,(unsigned long)lengths[j],&(md2[0]),NULL,EVP_md2());
+ EVP_Digest(buf,(unsigned long)lengths[j],&(md2[0]),NULL,EVP_md2(), NULL);
d=Time_F(STOP,usertime);
BIO_printf(bio_err,"%ld %s's in %.2fs\n",
count,names[D_MD2],d);
@@ -960,7 +960,7 @@ int MAIN(int argc, char **argv)
print_message(names[D_MDC2],c[D_MDC2][j],lengths[j]);
Time_F(START,usertime);
for (count=0,run=1; COND(c[D_MDC2][j]); count++)
- EVP_Digest(buf,(unsigned long)lengths[j],&(mdc2[0]),NULL,EVP_mdc2());
+ EVP_Digest(buf,(unsigned long)lengths[j],&(mdc2[0]),NULL,EVP_mdc2(), NULL);
d=Time_F(STOP,usertime);
BIO_printf(bio_err,"%ld %s's in %.2fs\n",
count,names[D_MDC2],d);
@@ -977,7 +977,7 @@ int MAIN(int argc, char **argv)
print_message(names[D_MD4],c[D_MD4][j],lengths[j]);
Time_F(START,usertime);
for (count=0,run=1; COND(c[D_MD4][j]); count++)
- EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md4[0]),NULL,EVP_md4());
+ EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md4[0]),NULL,EVP_md4(), NULL);
d=Time_F(STOP,usertime);
BIO_printf(bio_err,"%ld %s's in %.2fs\n",
count,names[D_MD4],d);
@@ -994,7 +994,8 @@ int MAIN(int argc, char **argv)
print_message(names[D_MD5],c[D_MD5][j],lengths[j]);
Time_F(START,usertime);
for (count=0,run=1; COND(c[D_MD5][j]); count++)
- EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,EVP_get_digestbyname("md5"));
+ EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,
+ EVP_get_digestbyname("md5"), NULL);
d=Time_F(STOP,usertime);
BIO_printf(bio_err,"%ld %s's in %.2fs\n",
count,names[D_MD5],d);
@@ -1038,7 +1039,7 @@ int MAIN(int argc, char **argv)
print_message(names[D_SHA1],c[D_SHA1][j],lengths[j]);
Time_F(START,usertime);
for (count=0,run=1; COND(c[D_SHA1][j]); count++)
- EVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1());
+ EVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1(), NULL);
d=Time_F(STOP,usertime);
BIO_printf(bio_err,"%ld %s's in %.2fs\n",
count,names[D_SHA1],d);
@@ -1054,7 +1055,7 @@ int MAIN(int argc, char **argv)
print_message(names[D_RMD160],c[D_RMD160][j],lengths[j]);
Time_F(START,usertime);
for (count=0,run=1; COND(c[D_RMD160][j]); count++)
- EVP_Digest(buf,(unsigned long)lengths[j],&(rmd160[0]),NULL,EVP_ripemd160());
+ EVP_Digest(buf,(unsigned long)lengths[j],&(rmd160[0]),NULL,EVP_ripemd160(), NULL);
d=Time_F(STOP,usertime);
BIO_printf(bio_err,"%ld %s's in %.2fs\n",
count,names[D_RMD160],d);