mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-08 16:54:31 +00:00
Change cookie rotator to use SHA1 digest for new cookies (#27392)
This commit is contained in:
parent
393e851649
commit
f37c93f3d7
|
@ -1,9 +1,6 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# TODO: Remove after 4.2.0
|
# TODO: remove this file some time after 4.3.0
|
||||||
Rails.application.configure do
|
|
||||||
config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA1
|
|
||||||
end
|
|
||||||
|
|
||||||
Rails.application.config.after_initialize do
|
Rails.application.config.after_initialize do
|
||||||
Rails.application.config.action_dispatch.cookies_rotations.tap do |cookies|
|
Rails.application.config.action_dispatch.cookies_rotations.tap do |cookies|
|
||||||
|
@ -12,9 +9,8 @@ Rails.application.config.after_initialize do
|
||||||
|
|
||||||
secret_key_base = Rails.application.secret_key_base
|
secret_key_base = Rails.application.secret_key_base
|
||||||
|
|
||||||
# TODO: Switch to SHA1 after 4.2.0
|
|
||||||
key_generator = ActiveSupport::KeyGenerator.new(
|
key_generator = ActiveSupport::KeyGenerator.new(
|
||||||
secret_key_base, iterations: 1000, hash_digest_class: OpenSSL::Digest::SHA256
|
secret_key_base, iterations: 1000, hash_digest_class: OpenSSL::Digest::SHA1
|
||||||
)
|
)
|
||||||
key_len = ActiveSupport::MessageEncryptor.key_len
|
key_len = ActiveSupport::MessageEncryptor.key_len
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue