lib/lockbox/encryptor.rb in lockbox-1.1.2 vs lib/lockbox/encryptor.rb in lockbox-1.2.0
- old
+ new
@@ -7,10 +7,10 @@
# warn "[lockbox] Lockbox 1.0 will default to encode: true. Pass encode: false to keep the current behavior." if @encode.nil?
previous_versions = options.delete(:previous_versions)
@boxes =
[Box.new(**options)] +
- Array(previous_versions).map { |v| Box.new(key: options[:key], **v) }
+ Array(previous_versions).reject { |v| v.key?(:master_key) }.map { |v| Box.new(key: options[:key], **v) }
end
def encrypt(message, **options)
message = check_string(message)
ciphertext = @boxes.first.encrypt(message, **options)