Skip to content

Commit

Permalink
Change cookie rotator to use SHA1 digest for new cookies (mastodon#27392
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ClearlyClaire authored and vmstan committed Jan 5, 2024
1 parent 3daf296 commit ee23b7d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions config/initializers/cookie_rotator.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# frozen_string_literal: true

# TODO: Remove after 4.2.0
Rails.application.configure do
config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA1
end
# TODO: remove this file some time after 4.3.0

Rails.application.config.after_initialize do
Rails.application.config.action_dispatch.cookies_rotations.tap do |cookies|
Expand All @@ -12,9 +9,8 @@

secret_key_base = Rails.application.secret_key_base

# TODO: Switch to SHA1 after 4.2.0
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

Expand Down

0 comments on commit ee23b7d

Please sign in to comment.