mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 06:18:05 +01:00
Require that unidentified access keys be exactly 16 bytes
This commit is contained in:
committed by
Jon Chambers
parent
966d4e29d4
commit
e6237480f8
@@ -544,6 +544,7 @@ public class AccountController {
|
||||
@PUT
|
||||
@Path("/attributes/")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@ChangesDeviceEnabledState
|
||||
public void setAccountAttributes(@Auth DisabledPermittedAuthenticatedAccount disabledPermittedAuth,
|
||||
@HeaderParam("X-Signal-Agent") String userAgent,
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.whispersystems.textsecuregcm.storage.Device.DeviceCapabilities;
|
||||
import org.whispersystems.textsecuregcm.util.ExactlySize;
|
||||
|
||||
public class AccountAttributes {
|
||||
|
||||
@@ -25,6 +26,7 @@ public class AccountAttributes {
|
||||
private String registrationLock;
|
||||
|
||||
@JsonProperty
|
||||
@ExactlySize({0, 16})
|
||||
private byte[] unidentifiedAccessKey;
|
||||
|
||||
@JsonProperty
|
||||
@@ -80,4 +82,9 @@ public class AccountAttributes {
|
||||
public boolean isDiscoverableByPhoneNumber() {
|
||||
return discoverableByPhoneNumber;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setUnidentifiedAccessKey(final byte[] unidentifiedAccessKey) {
|
||||
this.unidentifiedAccessKey = unidentifiedAccessKey;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user