diff options
author | Stan Hu <stanhu@gmail.com> | 2018-05-19 16:03:29 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-05-30 01:19:33 +0300 |
commit | b5c706326ada2c0d213dd512842c5f677d9d94f9 (patch) | |
tree | b0b23d8c5ab778d62523cc23d718bb32490543e8 /spec/models/concerns | |
parent | d3b39a835f1ef42d71ba7b478d9e7320c4167b4e (diff) |
Upgrade to Ruby 2.4.4
Fixes that make this work:
* A change in Ruby (https://github.com/ruby/ruby/commit/ce635262f53b760284d56bb1027baebaaec175d1)
requires passing in the exact required length for OpenSSL keys and IVs.
* Ensure the secrets.yml is generated before any prepended modules are
loaded. This is done by renaming the `secret_token.rb` initializer to
`01_secret_token.rb`, which is a bit ugly but involves the least impact on
other files.
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/has_variable_spec.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/models/concerns/has_variable_spec.rb b/spec/models/concerns/has_variable_spec.rb index f87869a2fdc..3fbe86c5b56 100644 --- a/spec/models/concerns/has_variable_spec.rb +++ b/spec/models/concerns/has_variable_spec.rb @@ -45,8 +45,10 @@ describe HasVariable do end it 'fails to decrypt if iv is incorrect' do - subject.encrypted_value_iv = SecureRandom.hex + # attr_encrypted expects the IV to be 16 bytes and base64-encoded + subject.encrypted_value_iv = [SecureRandom.hex(8)].pack('m') subject.instance_variable_set(:@value, nil) + expect { subject.value } .to raise_error(OpenSSL::Cipher::CipherError, 'bad decrypt') end |