Support an arbitrary number of digits

This commit is contained in:
Alexander Bakker 2019-03-25 19:34:57 +01:00
parent 4cf1a5efe4
commit 066a7447c0
4 changed files with 13 additions and 24 deletions

View file

@ -78,7 +78,8 @@ public abstract class OtpInfo implements Serializable {
}
public static boolean isDigitsValid(int digits) {
return digits == 6 || digits == 8;
// allow a max of 10 digits, as truncation will only extract 31 bits
return digits > 0 && digits <= 10;
}
public void setDigits(int digits) throws OtpInfoException {