Disable incremental MAC changes.

This commit is contained in:
Nicholas Tinsley 2023-10-11 14:16:50 -04:00
parent 985b569d29
commit 81e928f94e

View file

@ -41,7 +41,7 @@ class DigestingRequestBody(
override fun writeTo(sink: BufferedSink) {
val digestStream = ByteArrayOutputStream()
val inner = SkippingOutputStream(contentStart, sink.outputStream())
val isIncremental = outputStreamFactory is AttachmentCipherOutputStreamFactory
val isIncremental = outputStreamFactory is AttachmentCipherOutputStreamFactory && INCREMENTAL_MAC_SENDING_ENABLED
val sizeChoice: ChunkSizeChoice = ChunkSizeChoice.inferChunkSize(contentLength.toInt())
val outputStream: DigestingOutputStream = if (isIncremental) {
(outputStreamFactory as AttachmentCipherOutputStreamFactory).createIncrementalFor(inner, contentLength, sizeChoice, digestStream)
@ -95,5 +95,6 @@ class DigestingRequestBody(
companion object {
const val TAG = "DigestingRequestBody"
const val INCREMENTAL_MAC_SENDING_ENABLED = false
}
}