Accept spaces and dashes in secrets from Microsoft Authenticator

A user reported that importing was failing due to this issue
This commit is contained in:
Alexander Bakker 2021-07-22 21:07:32 +02:00
parent 68eb87b096
commit eb4b7b5d61

View file

@ -4,9 +4,9 @@ import android.content.Context;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.database.Cursor; import android.database.Cursor;
import com.beemdevelopment.aegis.encoding.Base32;
import com.beemdevelopment.aegis.encoding.Base64; import com.beemdevelopment.aegis.encoding.Base64;
import com.beemdevelopment.aegis.encoding.EncodingException; import com.beemdevelopment.aegis.encoding.EncodingException;
import com.beemdevelopment.aegis.otp.GoogleAuthInfo;
import com.beemdevelopment.aegis.otp.OtpInfo; import com.beemdevelopment.aegis.otp.OtpInfo;
import com.beemdevelopment.aegis.otp.OtpInfoException; import com.beemdevelopment.aegis.otp.OtpInfoException;
import com.beemdevelopment.aegis.otp.TotpInfo; import com.beemdevelopment.aegis.otp.TotpInfo;
@ -81,7 +81,7 @@ public class MicrosoftAuthImporter extends DatabaseImporter {
switch (entry.getType()) { switch (entry.getType()) {
case TYPE_TOTP: case TYPE_TOTP:
secret = Base32.decode(entry.getSecret()); secret = GoogleAuthInfo.parseSecret(entry.getSecret());
break; break;
case TYPE_MICROSOFT: case TYPE_MICROSOFT:
digits = 8; digits = 8;