Commit 3e6b13e2 authored by Andreas Schildbach's avatar Andreas Schildbach

Crypto: Throw if decryptBytes() is called with an empty ciphertext.

parent 6a83bf93
......@@ -209,6 +209,9 @@ public class Crypto {
* @throws IOException
public static byte[] decryptBytes(final String textToDecode, final char[] password) throws IOException {
if (textToDecode.isEmpty())
throw new IOException("empty ciphertext");
final byte[] decodeTextAsBytes;
try {
decodeTextAsBytes = BASE64_DECRYPT.decode(textToDecode);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment