Skip to content

Commit

Permalink
using OpenSSL instead of ruby-hmac gem
Browse files Browse the repository at this point in the history
  • Loading branch information
markburns committed Apr 29, 2012
1 parent ae6715f commit 7a0558b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/signature.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'hmac-sha2'
require 'openssl'

module Signature
class AuthenticationError < RuntimeError; end
Expand Down Expand Up @@ -90,7 +90,11 @@ def auth_hash
private

def signature(token)
HMAC::SHA256.hexdigest(token.secret, string_to_sign)
OpenSSL::HMAC.hexdigest(digest, token.secret, string_to_sign)
end

def digest
OpenSSL::Digest::Digest.new('sha256')
end

def string_to_sign
Expand Down

0 comments on commit 7a0558b

Please sign in to comment.