Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined instance var AS encryptor #31

Merged
merged 3 commits into from
Oct 6, 2020

Conversation

swiknaba
Copy link
Contributor

@swiknaba swiknaba commented Oct 6, 2020

creating new credentials fails with

0.4.0/lib/diffcrypt/rails/encrypted_configuration.rb:102:in `decrypt': undefined method `decrypt_and_verify' for nil:NilClass (NoMethodError)

it seems decrypt_and_verify is never called, thus @decrypt_and_verify is not populated and hence results in this error.

Not sure if

      def active_support_encryptor
        @active_support_encryptor = ActiveSupport::MessageEncryptor.new(
          [key].pack('H*'),
          cipher: @diffcrypt_file.cipher,
        )
      end

was intended to memorize the AS Message Encryptor instance, if so, we can drop in @active_support_encryptor ||= ....

@marcqualie
Copy link
Collaborator

Related to: #29

@marcqualie marcqualie merged commit 9956f67 into diffcrypt:master Oct 6, 2020
@swiknaba swiknaba deleted the fix-undefined-as-encryptor branch October 6, 2020 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants