Skip to content

Commit

Permalink
Don't include an incremental mac for InvalidAttachmentLocator FilePoi…
Browse files Browse the repository at this point in the history
…nters
  • Loading branch information
harry-signal authored Sep 9, 2024
1 parent 4d67ba9 commit d659c25
Show file tree
Hide file tree
Showing 23 changed files with 8 additions and 26 deletions.
12 changes: 8 additions & 4 deletions src/main/kotlin/Permutations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,20 @@ object Generators {
)

return Generators.permutation {
val incrementalMac: ByteArray? = some(Generators.bytes(16).nullable())
val backupLocator: FilePointer.BackupLocator? = someOneOf(backupLocatorGenerator)
val attachmentLocator: FilePointer.AttachmentLocator? = someOneOf(attachmentLocatorGenerator)
val invalidAttachmentLocator: FilePointer.InvalidAttachmentLocator? = someOneOf(invalidAttachmentLocatorGenerator)
val potentialIncrementalMac = some(Generators.bytes(16).nullable())
val incrementalMac = if (invalidAttachmentLocator == null) potentialIncrementalMac else null
val incrementalMacChunkSize: Int? = some(Generators.list(1024, 2048))

val contentType = some(contentTypeGenerator)
val blurHash = some(Generators.blurHashes().nullable())

frames += FilePointer(
backupLocator = someOneOf(backupLocatorGenerator),
attachmentLocator = someOneOf(attachmentLocatorGenerator),
invalidAttachmentLocator = someOneOf(invalidAttachmentLocatorGenerator),
backupLocator = backupLocator,
attachmentLocator = attachmentLocator,
invalidAttachmentLocator = invalidAttachmentLocator,
contentType = contentType,
incrementalMac = incrementalMac?.toByteString(),
incrementalMacChunkSize = if (incrementalMac != null) {
Expand Down
Binary file modified test-cases/account_data_08.binproto
Binary file not shown.
2 changes: 0 additions & 2 deletions test-cases/account_data_08.txtproto
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Frame {
wallpaperPhoto = FilePointer {
blurHash = "LfLh6Voa9NIW?wNF-ooL-;WAX8oy"
contentType = "image/png"
incrementalMac = <b0268c5da867e8b454754359d4337a3c>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
}
}
Expand Down
Binary file modified test-cases/chat_07.binproto
Binary file not shown.
2 changes: 0 additions & 2 deletions test-cases/chat_07.txtproto
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ Frame {
wallpaperPhoto = FilePointer {
blurHash = "LfLh6Voa9NIW?wNF-ooL-;WAX8oy"
contentType = "image/png"
incrementalMac = <b0268c5da867e8b454754359d4337a3c>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
}
}
Expand Down
Binary file modified test-cases/chat_item_contact_message_08.binproto
Binary file not shown.
2 changes: 0 additions & 2 deletions test-cases/chat_item_contact_message_08.txtproto
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ Frame {
contentType = "image/png"
fileName = "wPOZvhLDS"
height = 3033
incrementalMac = <591eeb9b35c876bc7f5b1be8870f7902>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 267
}
Expand Down
Binary file modified test-cases/chat_item_standard_message_long_text_08.binproto
Binary file not shown.
2 changes: 0 additions & 2 deletions test-cases/chat_item_standard_message_long_text_08.txtproto
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ Frame {
contentType = "image/gif"
fileName = "mkOGiGqMxxp"
height = 3428
incrementalMac = <d64ea836f23a4ce20c4220ab396c4b8e>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 21
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ Frame {
contentType = "image/png"
fileName = "FwzenIneLV"
height = 3189
incrementalMac = <66a1e4dfbdea011a4c4f4cdd16292569>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 665
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ Frame {
contentType = "image/gif"
fileName = "zeAEZObFnzTZMn"
height = 3097
incrementalMac = <22ad8089d8b31e0b8d6049955da8992e>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 3092
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ Frame {
contentType = "image/gif"
fileName = "zeAEZObFnzTZMn"
height = 3097
incrementalMac = <22ad8089d8b31e0b8d6049955da8992e>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 3092
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ Frame {
contentType = "image/gif"
fileName = "zeAEZObFnzTZMn"
height = 3097
incrementalMac = <22ad8089d8b31e0b8d6049955da8992e>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 3092
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ Frame {
contentType = "image/gif"
fileName = "zeAEZObFnzTZMn"
height = 3097
incrementalMac = <22ad8089d8b31e0b8d6049955da8992e>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 3092
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ Frame {
contentType = "image/gif"
fileName = "zeAEZObFnzTZMn"
height = 3097
incrementalMac = <22ad8089d8b31e0b8d6049955da8992e>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 3092
}
Expand Down
Binary file modified test-cases/chat_item_sticker_message_07.binproto
Binary file not shown.
2 changes: 0 additions & 2 deletions test-cases/chat_item_sticker_message_07.txtproto
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ Frame {
contentType = "image/apng"
fileName = "iGqMx"
height = 3586
incrementalMac = <bdefd49b44b4c8d19c47cb807844279f>
incrementalMacChunkSize = 2048
invalidAttachmentLocator = InvalidAttachmentLocator {}
width = 3822
}
Expand Down

0 comments on commit d659c25

Please sign in to comment.