lib/kms_encrypted/clients/test.rb in kms_encrypted-1.2.1 vs lib/kms_encrypted/clients/test.rb in kms_encrypted-1.2.2
- old
+ new
@@ -10,9 +10,11 @@
end
def decrypt(ciphertext, context: nil)
prefix, plaintext, stored_context = ciphertext.split(":")
+ decryption_failed! if prefix != PREFIX
+
context = generate_context(context) if context
decryption_failed! if context != stored_context
Base64.decode64(plaintext)
end