mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 14:26:53 +00:00
Add a check for missing uak in OptionalAccess
This commit is contained in:
1 parent
19944bfdb2
commit
88e2687e23
2 files changed
+22
No files matched your search
@@ -73,6 +73,11 @@ public class OptionalAccess {
|
||||
return;
|
||||
}
|
||||
|
||||
// At this point, any successful authentication requires a real access key on the target account
|
||||
if (targetAccount.get().getUnidentifiedAccessKey().isEmpty()) {
|
||||
throw new NotAuthorizedException(Response.Status.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
// Otherwise, access is gated by the caller having the unidentified-access key matching the target account.
|
||||
if (MessageDigest.isEqual(accessKey.get().getAccessKey(), targetAccount.get().getUnidentifiedAccessKey().get())) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user