Use secure_compare to verify the validity of the provided HMAC

parent 3ac5f670
......@@ -20,7 +20,7 @@ module Gitlab
def valid?
return false unless salt.present? && hmac.present?
hmac == generate_hmac
ActiveSupport::SecurityUtils.secure_compare(hmac, generate_hmac)
end
def encode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment