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

@@ -85,8 +85,7 @@ public class BackupManagerTest {
private static final MediaEncryptionParameters COPY_ENCRYPTION_PARAM = new MediaEncryptionParameters(
TestRandomUtil.nextBytes(32),
TestRandomUtil.nextBytes(32),
TestRandomUtil.nextBytes(16));
TestRandomUtil.nextBytes(32));
private static final CopyParameters COPY_PARAM = new CopyParameters(
3, "abc", 100,
COPY_ENCRYPTION_PARAM, TestRandomUtil.nextBytes(15));

View File

@@ -39,7 +39,6 @@ public class Cdn3RemoteStorageManagerTest {
private static final byte[] HMAC_KEY = TestRandomUtil.nextBytes(32);
private static final byte[] AES_KEY = TestRandomUtil.nextBytes(32);
private static final byte[] IV = TestRandomUtil.nextBytes(16);
@RegisterExtension
private static final WireMockExtension wireMock = WireMockExtension.newInstance()
@@ -66,7 +65,7 @@ public class Cdn3RemoteStorageManagerTest {
@ParameterizedTest
@ValueSource(ints = {2, 3})
public void copy(final int sourceCdn) throws JsonProcessingException {
final MediaEncryptionParameters encryptionParameters = new MediaEncryptionParameters(AES_KEY, HMAC_KEY, IV);
final MediaEncryptionParameters encryptionParameters = new MediaEncryptionParameters(AES_KEY, HMAC_KEY);
final String scheme = switch (sourceCdn) {
case 2 -> "gcs";
case 3 -> "r2";
@@ -99,7 +98,7 @@ public class Cdn3RemoteStorageManagerTest {
2,
"a/test/source",
100,
new MediaEncryptionParameters(AES_KEY, HMAC_KEY, IV),
new MediaEncryptionParameters(AES_KEY, HMAC_KEY),
"a/destination").toCompletableFuture());
}
@@ -111,7 +110,7 @@ public class Cdn3RemoteStorageManagerTest {
2,
"a/test/source",
100,
new MediaEncryptionParameters(AES_KEY, HMAC_KEY, IV),
new MediaEncryptionParameters(AES_KEY, HMAC_KEY),
"a/destination").toCompletableFuture());
}
@@ -122,7 +121,7 @@ public class Cdn3RemoteStorageManagerTest {
0,
"a/test/source",
100,
new MediaEncryptionParameters(AES_KEY, HMAC_KEY, IV),
new MediaEncryptionParameters(AES_KEY, HMAC_KEY),
"a/destination").toCompletableFuture());
}