mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-23 10:28:16 +01:00
Require that unidentified access keys be exactly 16 bytes
This commit is contained in:
committed by
Jon Chambers
parent
966d4e29d4
commit
e6237480f8
@@ -1673,6 +1673,21 @@ class AccountControllerTest {
|
||||
assertThat(response.getStatus()).isEqualTo(204);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSetAccountAttributesBadUnidentifiedKeyLength() {
|
||||
final AccountAttributes attributes = new AccountAttributes(false, 2222, null, null, false, null);
|
||||
attributes.setUnidentifiedAccessKey(new byte[7]);
|
||||
|
||||
Response response =
|
||||
resources.getJerseyTest()
|
||||
.target("/v1/accounts/attributes/")
|
||||
.request()
|
||||
.header("Authorization", AuthHelper.getAuthHeader(AuthHelper.VALID_UUID, AuthHelper.VALID_PASSWORD))
|
||||
.put(Entity.json(attributes));
|
||||
|
||||
assertThat(response.getStatus()).isEqualTo(422);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDeleteAccount() throws InterruptedException {
|
||||
Response response =
|
||||
|
||||
Reference in New Issue
Block a user