Skip to content

Commit 653725e

Browse files
authored
Merge pull request rails#49610 from ezekg/fix/note-on-rails-7-1-sha-1-bug
Add note on active_record.encryption.support_sha1_for_non_deterministic_encryption
2 parents 23e04dc + 88ed242 commit 653725e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

guides/source/upgrading_ruby_on_rails.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,22 @@ versions, there are two scenarios to consider:
335335
config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256
336336
```
337337

338+
See the [Configuring Rails Applications](configuring.html#config-active-record-encryption-hash-digest-class)
339+
guide for more information on `config.active_record.encryption.hash_digest_class`.
340+
341+
In addition, a new configuration [`config.active_record.encryption.support_sha1_for_non_deterministic_encryption`](configuring.html#config-active-record-encryption-support-sha1-for-non-deterministic-encryption)
342+
was introduced to resolve [a bug](https://github.com/rails/rails/issues/42922) that caused some attributes to be
343+
encrypted using SHA-1 even when SHA-256 was configured via the aforementioned `hash_digest_class` configuration.
344+
345+
By default, `config.active_record.encryption.support_sha1_for_non_deterministic_encryption` is disabled in
346+
Rails 7.1. If you have data encrypted in a version of Rails < 7.1 that you believe may be affected
347+
by the aforementioned bug, this configuration should be enabled:
348+
349+
```ruby
350+
config.active_record.encryption.support_sha1_for_non_deterministic_encryption = true
351+
```
352+
353+
If you are working with encrypted data, please carefully review the above.
338354

339355
Upgrading from Rails 6.1 to Rails 7.0
340356
-------------------------------------

0 commit comments

Comments
 (0)