Skip to content

Commit

Permalink
Merge pull request Shopify#349 from mikeyhew/fixed-size-secure-compare
Browse files Browse the repository at this point in the history
Use fixed-size `secure_compare` in `WebhookVerification#hmac_valid?`
  • Loading branch information
kevinhughes27 authored Oct 11, 2016
2 parents 47f8019 + 7fd2986 commit d9220f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/shopify_app/webhook_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def verify_request
def hmac_valid?(data)
secret = ShopifyApp.configuration.secret
digest = OpenSSL::Digest.new('sha256')
ActiveSupport::SecurityUtils.variable_size_secure_compare(
ActiveSupport::SecurityUtils.secure_compare(
shopify_hmac,
Base64.encode64(OpenSSL::HMAC.digest(digest, secret, data)).strip
)
Expand Down

0 comments on commit d9220f0

Please sign in to comment.