diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-17 11:23:14 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-08-17 11:23:14 -0700 |
commit | beff925c32c70981959aaa37531bcf4cd9c8ba28 (patch) | |
tree | 03251d8f33c0b575ce6bbcb21d8b97492c97a464 /activesupport | |
parent | 14965baa09771a80babc15dba42c864806f575f5 (diff) | |
parent | 29be3f5d8386fc9a8a67844fa9b7d6860574e715 (diff) | |
download | rails-beff925c32c70981959aaa37531bcf4cd9c8ba28.tar.gz rails-beff925c32c70981959aaa37531bcf4cd9c8ba28.tar.bz2 rails-beff925c32c70981959aaa37531bcf4cd9c8ba28.zip |
Merge pull request #16467 from strzalek/cookies-digest-config-option2
Cookies digest config option (pt. 2)
Conflicts:
actionpack/CHANGELOG.md
actionpack/lib/action_dispatch/middleware/cookies.rb
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/message_encryptor.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/message_encryptor.rb b/activesupport/lib/active_support/message_encryptor.rb index b019ad0dec..92ab6fe648 100644 --- a/activesupport/lib/active_support/message_encryptor.rb +++ b/activesupport/lib/active_support/message_encryptor.rb @@ -40,6 +40,7 @@ module ActiveSupport # Options: # * <tt>:cipher</tt> - Cipher to use. Can be any cipher returned by # <tt>OpenSSL::Cipher.ciphers</tt>. Default is 'aes-256-cbc'. + # * <tt>:digest</tt> - String of digest to use for signing. Default is +SHA1+. # * <tt>:serializer</tt> - Object serializer to use. Default is +Marshal+. def initialize(secret, *signature_key_or_options) options = signature_key_or_options.extract_options! @@ -47,7 +48,7 @@ module ActiveSupport @secret = secret @sign_secret = sign_secret @cipher = options[:cipher] || 'aes-256-cbc' - @verifier = MessageVerifier.new(@sign_secret || @secret, :serializer => NullSerializer) + @verifier = MessageVerifier.new(@sign_secret || @secret, digest: options[:digest] || 'SHA1', serializer: NullSerializer) @serializer = options[:serializer] || Marshal end |