diff --git a/service/pom.xml b/service/pom.xml index 41d7f497f..57eb6c922 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -53,9 +53,9 @@ ${project.version} - org.whispersystems - signal-client-java - 0.10.0 + org.signal + zkgroup-java + 0.8.2 org.whispersystems diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java index 8c402a309..3b9c50eda 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java @@ -703,7 +703,7 @@ public class SubscriptionController { this.receiptCredentialRequest = receiptCredentialRequest; } - @NotEmpty + @ExactlySize(ReceiptCredentialRequest.SIZE) public byte[] getReceiptCredentialRequest() { return receiptCredentialRequest; } @@ -719,7 +719,7 @@ public class SubscriptionController { this.receiptCredentialResponse = receiptCredentialResponse; } - @NotEmpty + @ExactlySize(ReceiptCredentialResponse.SIZE) public byte[] getReceiptCredentialResponse() { return receiptCredentialResponse; } diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java index f01ae859d..ab72a31ab 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/entities/RedeemReceiptRequest.java @@ -28,6 +28,7 @@ public class RedeemReceiptRequest { } @NotEmpty + @ExactlySize({ReceiptCredentialPresentation.SIZE}) public byte[] getReceiptCredentialPresentation() { return receiptCredentialPresentation; } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java index 486c85172..2092516dd 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/storage/IssuedReceiptsManagerTest.java @@ -56,7 +56,7 @@ class IssuedReceiptsManagerTest { @Test void testRecordIssuance() { Instant now = Instant.ofEpochSecond(NOW_EPOCH_SECONDS); - byte[] request1 = new byte[20]; + byte[] request1 = new byte[ReceiptCredentialRequest.SIZE]; SECURE_RANDOM.nextBytes(request1); when(receiptCredentialRequest.serialize()).thenReturn(request1); CompletableFuture future = issuedReceiptsManager.recordIssuance("item-1", receiptCredentialRequest, now); @@ -67,7 +67,7 @@ class IssuedReceiptsManagerTest { assertThat(future).succeedsWithin(Duration.ofSeconds(3)); // same item with new request should fail - byte[] request2 = new byte[20]; + byte[] request2 = new byte[ReceiptCredentialRequest.SIZE]; SECURE_RANDOM.nextBytes(request2); when(receiptCredentialRequest.serialize()).thenReturn(request2); future = issuedReceiptsManager.recordIssuance("item-1", receiptCredentialRequest, now); diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/tests/controllers/DonationControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/tests/controllers/DonationControllerTest.java index 99bbbfbbc..baed628cf 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/tests/controllers/DonationControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/tests/controllers/DonationControllerTest.java @@ -120,7 +120,7 @@ class DonationControllerTest { receiptSerialBytes = new byte[ReceiptSerial.SIZE]; SECURE_RANDOM.nextBytes(receiptSerialBytes); receiptSerial = new ReceiptSerial(receiptSerialBytes); - presentation = new byte[25]; + presentation = new byte[ReceiptCredentialPresentation.SIZE]; SECURE_RANDOM.nextBytes(presentation); receiptCredentialPresentationFactory = mock(DonationController.ReceiptCredentialPresentationFactory.class); receiptCredentialPresentation = mock(ReceiptCredentialPresentation.class);