Fix the andOTP and FreeOTP importers

This commit is contained in:
Alexander Bakker 2018-06-07 21:01:12 +02:00
parent 5000522381
commit 3f979843c7
2 changed files with 2 additions and 2 deletions

View file

@ -43,7 +43,7 @@ public class AndOtpImporter extends DatabaseImporter {
for (int i = 0; i < _obj.length(); i++) { for (int i = 0; i < _obj.length(); i++) {
JSONObject obj = _obj.getJSONObject(i); JSONObject obj = _obj.getJSONObject(i);
String type = obj.getString("type"); String type = obj.getString("type").toLowerCase();
String algo = obj.getString("algorithm"); String algo = obj.getString("algorithm");
int digits = obj.getInt("digits"); int digits = obj.getInt("digits");
byte[] secret = Base32.decode(obj.getString("secret").toCharArray()); byte[] secret = Base32.decode(obj.getString("secret").toCharArray());

View file

@ -56,7 +56,7 @@ public class FreeOtpImporter extends DatabaseImporter {
} else { } else {
JSONObject obj = new JSONObject(xmlEntry.Value); JSONObject obj = new JSONObject(xmlEntry.Value);
String type = obj.getString("type"); String type = obj.getString("type").toLowerCase();
String algo = obj.getString("algo"); String algo = obj.getString("algo");
int digits = obj.getInt("digits"); int digits = obj.getInt("digits");
byte[] secret = toBytes(obj.getJSONArray("secret")); byte[] secret = toBytes(obj.getJSONArray("secret"));