diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-15 14:59:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-15 14:59:32 +0000 |
commit | 2d33fc97a3742800e65bf647e5b66d0af58e7123 (patch) | |
tree | b6293b0c7edf8f59340a397b2c9d9bd3562b8247 /ext/digest/md5/md5ossl.c | |
parent | aadebb29da14b65f47cf3e08ac164e6fe191febe (diff) |
md5ossl.c: indicate the result
* ext/digest/md5/md5ossl.c: use OpenSSL EVP API instead of MD5 API
to perform MD5 hashes using OpenSSL in ext/digest.
[ruby-core:61614] [Bug #9659]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/md5/md5ossl.c')
-rw-r--r-- | ext/digest/md5/md5ossl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/digest/md5/md5ossl.c b/ext/digest/md5/md5ossl.c index d94ae2cd2f..d08d2db05e 100644 --- a/ext/digest/md5/md5ossl.c +++ b/ext/digest/md5/md5ossl.c @@ -2,8 +2,15 @@ #include "md5ossl.h" -void -MD5_Finish(MD5_CTX *pctx, unsigned char *digest) +int +rb_digest_md5osslevp_Init(EVP_MD_CTX *pctx) { - MD5_Final(digest, pctx); + return EVP_DigestInit_ex(pctx, EVP_md5(), NULL); +} + +int +rb_digest_md5osslevp_Finish(EVP_MD_CTX *pctx, unsigned char *digest) +{ + /* if EVP_DigestFinal_ex fails, we ignore that */ + return EVP_DigestFinal_ex(pctx, digest, NULL); } |