Don't rely on accountType to detect proprietary Authy tokens

This commit is contained in:
Alexander Bakker 2021-01-02 14:55:26 +01:00
parent ddbe9ccfb7
commit 951241e95d

View file

@ -235,7 +235,7 @@ public class AuthyImporter extends DatabaseImporter {
authyEntryInfo.AccountType = JsonUtils.optString(entry, "accountType");
authyEntryInfo.Name = entry.optString("name");
boolean isAuthy = !entry.optString("accountType", "authy").equals("authenticator");
boolean isAuthy = entry.has("secretSeed");
sanitizeEntryInfo(authyEntryInfo, isAuthy);
byte[] secret;
@ -246,7 +246,7 @@ public class AuthyImporter extends DatabaseImporter {
}
int digits = entry.getInt("digits");
OtpInfo info = new TotpInfo(secret, "SHA1", digits, digits == 7 ? 10 : 30);
OtpInfo info = new TotpInfo(secret, "SHA1", digits, isAuthy ? 10 : 30);
return new VaultEntry(info, authyEntryInfo.Name, authyEntryInfo.Issuer);
} catch (OtpInfoException | JSONException | EncodingException e) {
throw new DatabaseImporterEntryException(e, entry.toString());