From 2d33fc97a3742800e65bf647e5b66d0af58e7123 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 15 Jul 2014 14:59:32 +0000 Subject: 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 --- ext/digest/md5/md5ossl.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'ext/digest/md5/md5ossl.c') 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); } -- cgit v1.2.3