Browse files

Added the following patch from the mailing list:

Original Message:
zblut at zblut at
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


Patch format wasn't correct, seemed to be from a darcs output, but wasn't in the repo.  Applied the patch manually.
  • Loading branch information...
Lilli committed Feb 11, 2010
1 parent c06bd57 commit 16e8cf107bea48c1be8bc285bb567236a57af04c
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/openid/cryptutil.rb
@@ -4,8 +4,15 @@
require "digest/hmac"
rescue LoadError
- require "hmac/sha1"
- require "hmac/sha2"
+ begin
+ # Try loading the ruby-hmac files if they exist
+ require "hmac-sha1"
+ require "hmac-sha2"
+ rescue LoadError
+ # Nothing exists use included hmac files
+ require "hmac/sha1"
+ require "hmac/sha2"
+ end
module OpenID

0 comments on commit 16e8cf1

Please sign in to comment.