mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Include protocol version in group ID derivation.
This commit is contained in:
@@ -11,6 +11,9 @@ import org.briarproject.bramble.util.StringUtils;
|
|||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static org.briarproject.bramble.api.sync.GroupId.LABEL;
|
||||||
|
import static org.briarproject.bramble.api.sync.SyncConstants.PROTOCOL_VERSION;
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
class GroupFactoryImpl implements GroupFactory {
|
class GroupFactoryImpl implements GroupFactory {
|
||||||
@@ -24,7 +27,7 @@ class GroupFactoryImpl implements GroupFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Group createGroup(ClientId c, byte[] descriptor) {
|
public Group createGroup(ClientId c, byte[] descriptor) {
|
||||||
byte[] hash = crypto.hash(GroupId.LABEL,
|
byte[] hash = crypto.hash(LABEL, new byte[] {PROTOCOL_VERSION},
|
||||||
StringUtils.toUtf8(c.getString()), descriptor);
|
StringUtils.toUtf8(c.getString()), descriptor);
|
||||||
return new Group(new GroupId(hash), c, descriptor);
|
return new Group(new GroupId(hash), c, descriptor);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user