Fix failing AttachmentCipherTest for incremental mac.
This commit is contained in:
parent
648506fe04
commit
8fc03a67b9
3 changed files with 2 additions and 8 deletions
|
@ -179,11 +179,8 @@ public class SignalServiceMessageReceiver {
|
|||
byte[] manifestBytes = socket.retrieveStickerManifest(packId);
|
||||
|
||||
InputStream cipherStream = AttachmentCipherInputStream.createForStickerData(manifestBytes, packKey);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
Util.copy(cipherStream, outputStream);
|
||||
|
||||
StickerProtos.Pack pack = StickerProtos.Pack.parseFrom(outputStream.toByteArray());
|
||||
StickerProtos.Pack pack = StickerProtos.Pack.parseFrom(Util.readFullyAsBytes(cipherStream));
|
||||
List<SignalServiceStickerManifest.StickerInfo> stickers = new ArrayList<>(pack.getStickersCount());
|
||||
SignalServiceStickerManifest.StickerInfo cover = pack.hasCover() ? new SignalServiceStickerManifest.StickerInfo(pack.getCover().getId(), pack.getCover().getEmoji(), pack.getCover().getContentType())
|
||||
: null;
|
||||
|
|
|
@ -120,7 +120,6 @@ public class Util {
|
|||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
}
|
||||
|
||||
public static void sleep(long millis) {
|
||||
|
|
|
@ -333,9 +333,7 @@ public final class AttachmentCipherTest {
|
|||
}
|
||||
|
||||
private static byte[] readInputStreamFully(InputStream inputStream) throws IOException {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
Util.copy(inputStream, outputStream);
|
||||
return outputStream.toByteArray();
|
||||
return Util.readFullyAsBytes(inputStream);
|
||||
}
|
||||
|
||||
private static byte[] expandPackKey(byte[] shortKey) {
|
||||
|
|
Loading…
Add table
Reference in a new issue