Encrypter and decrypter for segmented transports (untested).

This commit is contained in:
akwizgran
2012-01-13 11:54:55 +00:00
parent ab9b05448d
commit 90e54d94e6
17 changed files with 264 additions and 115 deletions

View File

@@ -15,6 +15,7 @@ import javax.crypto.Mac;
import net.sf.briar.BriarTestCase;
import net.sf.briar.api.crypto.CryptoComponent;
import net.sf.briar.api.crypto.ErasableKey;
import net.sf.briar.api.plugins.FrameSource;
import net.sf.briar.api.transport.ConnectionReader;
import net.sf.briar.api.transport.ConnectionWriter;
import net.sf.briar.crypto.CryptoModule;
@@ -89,8 +90,8 @@ public class FrameReadWriteTest extends BriarTestCase {
assertArrayEquals(tag, recoveredTag);
assertTrue(TagEncoder.validateTag(tag, 0, tagCipher, tagKey));
// Read the frames back
ConnectionDecrypter decrypter = new ConnectionDecrypterImpl(in,
frameCipher, frameKey, mac.getMacLength());
FrameSource decrypter = new ConnectionDecrypter(in, frameCipher,
frameKey, mac.getMacLength());
ConnectionReader reader = new ConnectionReaderImpl(decrypter, mac,
macKey);
InputStream in1 = reader.getInputStream();