mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-29 01:58:09 +00:00
Merge pull request #652 from alexbakker/fix-authy-import
Don't rely on accountType to detect proprietary Authy tokens
This commit is contained in:
commit
38bbb60414
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue