mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-30 12:56:17 +00:00
Accept any length group link password.
This commit is contained in:
@@ -26,7 +26,6 @@ public final class GroupInviteLinkUrl {
|
||||
|
||||
public static GroupInviteLinkUrl forGroup(@NonNull GroupMasterKey groupMasterKey,
|
||||
@NonNull DecryptedGroup group)
|
||||
throws GroupLinkPassword.InvalidLengthException
|
||||
{
|
||||
return new GroupInviteLinkUrl(groupMasterKey, GroupLinkPassword.fromBytes(group.getInviteLinkPassword().toByteArray()));
|
||||
}
|
||||
@@ -73,7 +72,7 @@ public final class GroupInviteLinkUrl {
|
||||
}
|
||||
default: throw new UnknownGroupLinkVersionException("Url contains no known group link content");
|
||||
}
|
||||
} catch (GroupLinkPassword.InvalidLengthException | InvalidInputException | IOException e){
|
||||
} catch (InvalidInputException | IOException e) {
|
||||
throw new InvalidGroupLinkException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,7 @@ public final class GroupLinkPassword {
|
||||
return new GroupLinkPassword(Util.getSecretBytes(SIZE));
|
||||
}
|
||||
|
||||
public static @NonNull GroupLinkPassword fromBytes(@NonNull byte[] bytes) throws InvalidLengthException {
|
||||
if (bytes.length != SIZE) {
|
||||
throw new InvalidLengthException();
|
||||
}
|
||||
|
||||
public static @NonNull GroupLinkPassword fromBytes(@NonNull byte[] bytes) {
|
||||
return new GroupLinkPassword(bytes);
|
||||
}
|
||||
|
||||
@@ -45,7 +41,4 @@ public final class GroupLinkPassword {
|
||||
public int hashCode() {
|
||||
return Arrays.hashCode(bytes);
|
||||
}
|
||||
|
||||
public static class InvalidLengthException extends Exception {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user