Skip to content

Commit 16e8cf1

Browse files
author
Lilli
committed
Added the following patch from the [email protected] mailing list:
http://lists.openidenabled.com/pipermail/dev/attachments/20091101/9a551153/attachment.bin Original Message: zblut at cerego.co.jp zblut at cerego.co.jp Sun Nov 1 23:18:16 PST 2009 darcs patch: This is a quick hack to try and load the ruby-hmac imp... "* This is a quick hack to try and load the ruby-hmac implementations of hmac-sha1 and sha2, because if a user has ruby-oauth installed on the same system with ruby-openid, the user will get really annoying warning messages about hmac CONSTANTS being overwritten. A diff of the code shows that these hmac implementations are the same code, so this should be safe. silence_hmac_warnings_with_oauth_gem" Patch format wasn't correct, seemed to be from a darcs output, but wasn't in the repo. Applied the patch manually.
1 parent c06bd57 commit 16e8cf1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/openid/cryptutil.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
begin
55
require "digest/hmac"
66
rescue LoadError
7-
require "hmac/sha1"
8-
require "hmac/sha2"
7+
begin
8+
# Try loading the ruby-hmac files if they exist
9+
require "hmac-sha1"
10+
require "hmac-sha2"
11+
rescue LoadError
12+
# Nothing exists use included hmac files
13+
require "hmac/sha1"
14+
require "hmac/sha2"
15+
end
916
end
1017

1118
module OpenID

0 commit comments

Comments
 (0)