diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-03-02 19:38:01 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2017-03-02 19:38:01 +0100 |
commit | e3b4554f231beb789b981dfb5e32789f5ad4d17b (patch) | |
tree | 5a74279b6dcd4e3af8d2389656b3816334b38c5b /railties/lib/rails | |
parent | f2eb3417f24cddf8a407d1cc4ae6ea4ec62d3aab (diff) | |
download | rails-e3b4554f231beb789b981dfb5e32789f5ad4d17b.tar.gz rails-e3b4554f231beb789b981dfb5e32789f5ad4d17b.tar.bz2 rails-e3b4554f231beb789b981dfb5e32789f5ad4d17b.zip |
Move key packing into encryptor.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/secrets.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/railties/lib/rails/secrets.rb b/railties/lib/rails/secrets.rb index f42515f47d..77d9249c56 100644 --- a/railties/lib/rails/secrets.rb +++ b/railties/lib/rails/secrets.rb @@ -39,8 +39,7 @@ module Rails end def key - [(ENV["RAILS_MASTER_KEY"] || read_key_file || handle_missing_key)] - .pack("H*") + ENV["RAILS_MASTER_KEY"] || read_key_file || handle_missing_key end def encrypt(data) @@ -103,7 +102,7 @@ module Rails end def encryptor - @encryptor ||= ActiveSupport::MessageEncryptor.new(key, cipher: CIPHER) + @encryptor ||= ActiveSupport::MessageEncryptor.new([ key ].pack("H*"), cipher: CIPHER) end end end |