mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Fix failing AttachmentCipherTest for incremental mac.
This commit is contained in:
@@ -179,11 +179,8 @@ public class SignalServiceMessageReceiver {
|
|||||||
byte[] manifestBytes = socket.retrieveStickerManifest(packId);
|
byte[] manifestBytes = socket.retrieveStickerManifest(packId);
|
||||||
|
|
||||||
InputStream cipherStream = AttachmentCipherInputStream.createForStickerData(manifestBytes, packKey);
|
InputStream cipherStream = AttachmentCipherInputStream.createForStickerData(manifestBytes, packKey);
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
||||||
|
|
||||||
Util.copy(cipherStream, outputStream);
|
StickerProtos.Pack pack = StickerProtos.Pack.parseFrom(Util.readFullyAsBytes(cipherStream));
|
||||||
|
|
||||||
StickerProtos.Pack pack = StickerProtos.Pack.parseFrom(outputStream.toByteArray());
|
|
||||||
List<SignalServiceStickerManifest.StickerInfo> stickers = new ArrayList<>(pack.getStickersCount());
|
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())
|
SignalServiceStickerManifest.StickerInfo cover = pack.hasCover() ? new SignalServiceStickerManifest.StickerInfo(pack.getCover().getId(), pack.getCover().getEmoji(), pack.getCover().getContentType())
|
||||||
: null;
|
: null;
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ public class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
in.close();
|
in.close();
|
||||||
out.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sleep(long millis) {
|
public static void sleep(long millis) {
|
||||||
|
|||||||
@@ -333,9 +333,7 @@ public final class AttachmentCipherTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] readInputStreamFully(InputStream inputStream) throws IOException {
|
private static byte[] readInputStreamFully(InputStream inputStream) throws IOException {
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
return Util.readFullyAsBytes(inputStream);
|
||||||
Util.copy(inputStream, outputStream);
|
|
||||||
return outputStream.toByteArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] expandPackKey(byte[] shortKey) {
|
private static byte[] expandPackKey(byte[] shortKey) {
|
||||||
|
|||||||
Reference in New Issue
Block a user