Use namespaced strings for client IDs

This commit is contained in:
Torsten Grote
2016-11-07 19:30:23 -02:00
parent 1809943f1d
commit e96b3a8c68
48 changed files with 131 additions and 195 deletions

View File

@@ -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);
}
}