diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-10-16 01:24:29 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-10-16 01:24:29 +0000 |
commit | 20d2186c87dabec56c6da48961a779843724a019 (patch) | |
tree | 4c5c2ba2e12a851c48726b6e5cc83a006f8291f1 /apps/passwd.c | |
parent | 9ba3ec91766e559f96248fe10c77551a4e017ec3 (diff) | |
download | openssl-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/passwd.c')
-rw-r--r-- | apps/passwd.c | 12 |
1 files changed, 6 insertions, 6 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); |