be safer when processing parts in AttachmentDownloadJob

Closes #4166
// FREEBIE
This commit is contained in:
Jake McGinty
2015-10-01 12:28:29 -07:00
committed by Moxie Marlinspike
parent c6abb7dc64
commit cdf982a356
5 changed files with 93 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
package org.thoughtcrime.securesms.crypto;
import org.junit.Before;
import org.junit.Test;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.thoughtcrime.securesms.BaseUnitTest;
import org.whispersystems.libaxolotl.InvalidMessageException;
@PowerMockIgnore("javax.crypto.*")
public class MasterCipherTest extends BaseUnitTest {
private MasterCipher masterCipher;
@Before
@Override
public void setUp() throws Exception {
super.setUp();
masterCipher = new MasterCipher(masterSecret);
}
@Test(expected = InvalidMessageException.class)
public void testEncryptBytesWithZeroBody() throws Exception {
masterCipher.decryptBytes(new byte[]{});
}
}