aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/message_encryptor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/message_encryptor.rb')
-rw-r--r--activesupport/lib/active_support/message_encryptor.rb17
1 files changed, 0 insertions, 17 deletions
diff --git a/activesupport/lib/active_support/message_encryptor.rb b/activesupport/lib/active_support/message_encryptor.rb
index 9ef2b29580..7d8a7fb687 100644
--- a/activesupport/lib/active_support/message_encryptor.rb
+++ b/activesupport/lib/active_support/message_encryptor.rb
@@ -24,29 +24,12 @@ module ActiveSupport
OpenSSLCipherError = OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError
def initialize(secret, options = {})
- unless options.is_a?(Hash)
- ActiveSupport::Deprecation.warn "The second parameter should be an options hash. Use :cipher => 'algorithm' to specify the cipher algorithm."
- options = { :cipher => options }
- end
-
@secret = secret
@cipher = options[:cipher] || 'aes-256-cbc'
@verifier = MessageVerifier.new(@secret, :serializer => NullSerializer)
@serializer = options[:serializer] || Marshal
end
- def encrypt(value)
- ActiveSupport::Deprecation.warn "MessageEncryptor#encrypt is deprecated as it is not safe without a signature. " \
- "Please use MessageEncryptor#encrypt_and_sign instead."
- _encrypt(value)
- end
-
- def decrypt(value)
- ActiveSupport::Deprecation.warn "MessageEncryptor#decrypt is deprecated as it is not safe without a signature. " \
- "Please use MessageEncryptor#decrypt_and_verify instead."
- _decrypt(value)
- end
-
# Encrypt and sign a message. We need to sign the message in order to avoid padding attacks.
# Reference: http://www.limited-entropy.com/padding-oracle-attacks
def encrypt_and_sign(value)