diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/message_verifier.rb | 12 | ||||
-rw-r--r-- | activesupport/lib/active_support/multibyte/unicode.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/values/unicode_tables.dat | bin | 904640 -> 1001806 bytes |
3 files changed, 11 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/message_verifier.rb b/activesupport/lib/active_support/message_verifier.rb index 4e0796f4f8..a8a8de5672 100644 --- a/activesupport/lib/active_support/message_verifier.rb +++ b/activesupport/lib/active_support/message_verifier.rb @@ -40,7 +40,7 @@ module ActiveSupport data, digest = signed_message.split("--") if data.present? && digest.present? && ActiveSupport::SecurityUtils.secure_compare(digest, generate_digest(data)) begin - @serializer.load(::Base64.strict_decode64(data)) + @serializer.load(decode(data)) rescue ArgumentError => argument_error raise InvalidSignature if argument_error.message =~ %r{invalid base64} raise @@ -51,11 +51,19 @@ module ActiveSupport end def generate(value) - data = ::Base64.strict_encode64(@serializer.dump(value)) + data = encode(@serializer.dump(value)) "#{data}--#{generate_digest(data)}" end private + def encode(data) + ::Base64.strict_encode64(data) + end + + def decode(data) + ::Base64.strict_decode64(data) + end + def generate_digest(data) require 'openssl' unless defined?(OpenSSL) OpenSSL::HMAC.hexdigest(OpenSSL::Digest.const_get(@digest).new, @secret, data) diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb index 7d45961515..7ab6293b60 100644 --- a/activesupport/lib/active_support/multibyte/unicode.rb +++ b/activesupport/lib/active_support/multibyte/unicode.rb @@ -11,7 +11,7 @@ module ActiveSupport NORMALIZATION_FORMS = [:c, :kc, :d, :kd] # The Unicode version that is supported by the implementation - UNICODE_VERSION = '6.3.0' + UNICODE_VERSION = '7.0.0' # The default normalization used for operations that require # normalization. It can be set to any of the normalizations diff --git a/activesupport/lib/active_support/values/unicode_tables.dat b/activesupport/lib/active_support/values/unicode_tables.dat Binary files differindex 394ee95f4b..760be4c07a 100644 --- a/activesupport/lib/active_support/values/unicode_tables.dat +++ b/activesupport/lib/active_support/values/unicode_tables.dat |