mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Use namespaced strings for client IDs
This commit is contained in:
@@ -5,6 +5,7 @@ import org.briarproject.api.sync.ClientId;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupFactory;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.util.StringUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -18,7 +19,9 @@ class GroupFactoryImpl implements GroupFactory {
|
||||
}
|
||||
|
||||
public Group createGroup(ClientId c, byte[] descriptor) {
|
||||
byte[] hash = crypto.hash(GroupId.LABEL, c.getBytes(), descriptor);
|
||||
byte[] hash =
|
||||
crypto.hash(GroupId.LABEL, StringUtils.toUtf8(c.getString()),
|
||||
descriptor);
|
||||
return new Group(new GroupId(hash), c, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user