Let server generate copyToMedia IVs

We include the IV in the encrypted payload, so we can let the server
choose them instead of the client
This commit is contained in:
Ravi Khadiwala
2024-10-28 17:28:23 -05:00
committed by Jon Chambers
parent a5f60b1522
commit f2cb04817b
6 changed files with 22 additions and 41 deletions

View File

@@ -512,19 +512,13 @@ public class ArchiveController {
@JsonDeserialize(using = ByteArrayAdapter.Deserializing.class)
@NotNull
@ExactlySize(32)
byte[] encryptionKey,
@Schema(description = "A 16-byte IV for AES, encoded in standard padded base64", implementation = String.class)
@JsonDeserialize(using = ByteArrayAdapter.Deserializing.class)
@NotNull
@ExactlySize(16)
byte[] iv) {
byte[] encryptionKey) {
CopyParameters toCopyParameters() {
return new CopyParameters(
sourceAttachment.cdn(), sourceAttachment.key(),
objectLength,
new MediaEncryptionParameters(encryptionKey, hmacKey, iv),
new MediaEncryptionParameters(encryptionKey, hmacKey),
mediaId);
}
}