summaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_hmac.c
diff options
context:
space:
mode:
authoremboss <emboss@ruby-lang.org>2011-07-22 04:11:38 +0000
committeremboss <emboss@ruby-lang.org>2011-07-22 04:11:38 +0000
commitf68570f870cb2b04da02aae71b97206c7e0735f9 (patch)
treec7b4b136de7610dec0529b8628283ff90641074b /ext/openssl/ossl_hmac.c
parent81a5fff6715a809ec2ea624b84eebe8c741297a5 (diff)
downloadruby-openssl-history-f68570f870cb2b04da02aae71b97206c7e0735f9.tar.gz
* ext/openssl/ossl_hmac.c: Revert checking return type of
HMAC_Init_ex as it is not compatible with OpenSSL < 1.0.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_hmac.c')
-rw-r--r--ext/openssl/ossl_hmac.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/openssl/ossl_hmac.c b/ext/openssl/ossl_hmac.c
index 5d29b8f..5220c9e 100644
--- a/ext/openssl/ossl_hmac.c
+++ b/ext/openssl/ossl_hmac.c
@@ -70,10 +70,8 @@ ossl_hmac_initialize(VALUE self, VALUE key, VALUE digest)
StringValue(key);
GetHMAC(self, ctx);
- if (HMAC_Init_ex(ctx, RSTRING_PTR(key), RSTRING_LENINT(key),
- GetDigestPtr(digest), NULL) != 1) {
- ossl_raise(eHMACError, "HMAC initialization failed.");
- }
+ HMAC_Init(ctx, RSTRING_PTR(key), RSTRING_LENINT(key),
+ GetDigestPtr(digest));
return self;
}
@@ -182,9 +180,7 @@ ossl_hmac_reset(VALUE self)
HMAC_CTX *ctx;
GetHMAC(self, ctx);
- if (HMAC_Init_ex(ctx, NULL, 0, NULL, NULL) != 1) {
- ossl_raise(eHMACError, "HMAC initialization failed");
- }
+ HMAC_Init(ctx, NULL, 0, NULL);
return self;
}