Ensure GV1 length is exactly the length expected.

This commit is contained in:
Alan Evans
2020-07-21 15:27:50 -03:00
committed by Greyson Parrelli
parent 0815715f7b
commit 8e962bf992
6 changed files with 29 additions and 18 deletions

View File

@@ -40,7 +40,7 @@ public abstract class GroupId {
}
public static @NonNull GroupId.V1 v1(byte[] gv1GroupIdBytes) throws BadGroupIdException {
if (gv1GroupIdBytes.length == V2_BYTE_LENGTH) {
if (gv1GroupIdBytes.length != MMS_BYTE_LENGTH) {
throw new BadGroupIdException();
}
return new GroupId.V1(gv1GroupIdBytes);