lib/vault/rails.rb in vault-rails-0.3.1 vs lib/vault/rails.rb in vault-rails-0.3.2
- old
+ new
@@ -142,11 +142,11 @@
protected
# Perform in-memory encryption. This is useful for testing and development.
def memory_encrypt(path, key, plaintext, client)
- log_warning(DEV_WARNING)
+ log_warning(DEV_WARNING) if self.in_memory_warnings_enabled?
return nil if plaintext.nil?
cipher = OpenSSL::Cipher::AES.new(128, :CBC)
cipher.encrypt
@@ -154,10 +154,10 @@
return Base64.strict_encode64(cipher.update(plaintext) + cipher.final)
end
# Perform in-memory decryption. This is useful for testing and development.
def memory_decrypt(path, key, ciphertext, client)
- log_warning(DEV_WARNING)
+ log_warning(DEV_WARNING) if self.in_memory_warnings_enabled?
return nil if ciphertext.nil?
cipher = OpenSSL::Cipher::AES.new(128, :CBC)
cipher.decrypt