22 lines
868 B
Diff
22 lines
868 B
Diff
|
--- usr/local/bundle/gems/ruby-openid-2.3.0/lib/openid/cryptutil.rb.old 2018-10-07 08:53:33.612724431 +0000
|
||
|
+++ usr/local/bundle/gems/ruby-openid-2.3.0/lib/openid/cryptutil.rb 2018-10-07 08:54:03.016525355 +0000
|
||
|
@@ -39,6 +39,6 @@
|
||
|
def CryptUtil.hmac_sha1(key, text)
|
||
|
- if Digest.const_defined? :HMAC
|
||
|
- Digest::HMAC.new(key,Digest::SHA1).update(text).digest
|
||
|
+ if defined? OpenSSL
|
||
|
+ OpenSSL::HMAC.digest(OpenSSL::Digest::SHA1.new, key, text)
|
||
|
else
|
||
|
return HMAC::SHA1.digest(key, text)
|
||
|
end
|
||
|
@@ -50,7 +50,7 @@
|
||
|
|
||
|
def CryptUtil.hmac_sha256(key, text)
|
||
|
- if Digest.const_defined? :HMAC
|
||
|
- Digest::HMAC.new(key,Digest::SHA256).update(text).digest
|
||
|
+ if defined? OpenSSL
|
||
|
+ OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, key, text)
|
||
|
else
|
||
|
return HMAC::SHA256.digest(key, text)
|
||
|
end
|