keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

ArgumentOutOfRangeException when trying to open database

Open talbotfox opened this issue 6 years ago • 8 comments

Description

Trying to open up a KDBX 4 Google Drive hosted database with a master key (also on Google Drive) and a master password (length: 32) results in an ArgumentOutOfRangeException.

Expected Behavior

  • The database should open normally without error.

Current Behavior

  • A toast is displayed on the bottom of the page with the message: "An error occured [sic]: Specified argument was out of the range of valid values. Parameter name: p.Memory".
  • Database does not unlock.

Bug information

Steps to Reproduce

  1. Create a KDBX 4 database and key with an external software (in my case, Keepass XC).
  2. Upload said database and key to Google Drive.
  3. Install Keepass2Android v. 1.07-r1.
  4. Open file -> Google Drive.
  5. Accept all permission requests.
  6. Select database (.kdbx file).
  7. Input password (length: 32) and load key (.key file) from same Google Drive location.
  8. Unlock.

Logs

2019-10-14 12:54:12 PM:573 -- AppSettingsActivity.OnPause
2019-10-14 12:54:12 PM:590 -- PasswordActivity.OnStart
2019-10-14 12:54:12 PM:591 -- PasswordActivity.OnResume
2019-10-14 12:54:12 PM:591 --  DB null
2019-10-14 12:54:12 PM:592 -- starting: True, Finishing: False, _performingLoad: False
2019-10-14 12:54:12 PM:593 -- Pre-loading database file starting
2019-10-14 12:54:12 PM:599 -- CFS: OpenWhenNoLocalChanges
2019-10-14 12:54:12 PM:599 -- CFS: hashing cached version
2019-10-14 12:54:13 PM:228 -- AppSettingsActivity.OnStop
2019-10-14 12:54:13 PM:229 -- AppSettingsActivity.OnDestroyTrue
2019-10-14 12:54:13 PM:604 -- CFS: Files in Sync
2019-10-14 12:54:13 PM:607 -- Pre-loading database file completed
2019-10-14 12:54:18 PM:424 -- PasswordActivity.OnPause
2019-10-14 12:54:18 PM:433 -- FSSA.OnCreate
2019-10-14 12:54:18 PM:470 -- LockingActivity: OnActivityResult
2019-10-14 12:54:18 PM:470 -- PasswordActivity.OnActivityResult 874348/1000
2019-10-14 12:54:18 PM:475 -- PasswordActivity.OnResume
2019-10-14 12:54:18 PM:476 --  DB null
2019-10-14 12:54:18 PM:476 -- starting: False, Finishing: False, _performingLoad: False
2019-10-14 12:54:18 PM:481 -- PasswordActivity.OnPause
2019-10-14 12:54:18 PM:494 -- FSSA.OnCreate
2019-10-14 12:54:18 PM:544 -- LockingActivity: OnActivityResult
2019-10-14 12:54:18 PM:544 -- PasswordActivity.OnActivityResult 874348/1004
2019-10-14 12:54:18 PM:545 -- PasswordActivity.OnResume
2019-10-14 12:54:18 PM:545 --  DB null
2019-10-14 12:54:18 PM:546 -- CFS: OpenWhenNoLocalChanges
2019-10-14 12:54:18 PM:546 -- starting: False, Finishing: False, _performingLoad: True
2019-10-14 12:54:18 PM:546 -- CFS: hashing cached version
2019-10-14 12:54:19 PM:301 -- CFS: Files in Sync
2019-10-14 12:54:19 PM:319 -- status message: Initializing...
2019-10-14 12:54:19 PM:319 -- status submessage:
2019-10-14 12:54:19 PM:334 -- status message: Loading database…
2019-10-14 12:54:19 PM:337 -- status submessage: Transforming master key…
2019-10-14 12:54:19 PM:339 -- System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: p.Memory

at KeePassLib.Cryptography.KeyDerivation.Argon2Kdf.Transform (System.Byte[] pbMsg, KeePassLib.Cryptography.KeyDerivation.KdfParameters p) [0x00095] in <61fc8b0249294004aa7834121b1dc4a1>:0
at KeePassLib.Keys.CompositeKey.GenerateKey32 (KeePassLib.Cryptography.KeyDerivation.KdfParameters p, System.Byte[] mPbMasterSeed) [0x00087] in <61fc8b0249294004aa7834121b1dc4a1>:0
at KeePassLib.Serialization.KdbxFile.ComputeKeys (System.Byte[]& pbCipherKey, System.Int32 cbCipherKey, System.Byte[]& pbHmacKey64) [0x00048] in <61fc8b0249294004aa7834121b1dc4a1>:0
at KeePassLib.Serialization.KdbxFile.Load (System.IO.Stream sSource, KeePassLib.Serialization.KdbxFormat fmt, KeePassLib.Interfaces.IStatusLogger slLogger) [0x000c0] in <61fc8b0249294004aa7834121b1dc4a1>:0
at keepass2android.KdbxDatabaseFormat.PopulateDatabaseFromStream (KeePassLib.PwDatabase db, System.IO.Stream s, KeePassLib.Interfaces.IStatusLogger slLogger) [0x00013] in <d9555282dea14061ab4400355adad9e4>:0
at KeePassLib.PwDatabase.Open (System.IO.Stream s, System.String fileNameWithoutPathAndExt, KeePassLib.Serialization.IOConnectionInfo ioSource, KeePassLib.Keys.CompositeKey pwKey, KeePassLib.Interfaces.IStatusLogger slLogger, KeePassLib.IDatabaseFormat format) [0x000a6] in <61fc8b0249294004aa7834121b1dc4a1>:0
at keepass2android.Database.PopulateDatabaseFromStream (KeePassLib.PwDatabase pwDatabase, System.IO.Stream s, KeePassLib.Serialization.IOConnectionInfo iocInfo, KeePassLib.Keys.CompositeKey compositeKey, keepass2android.ProgressDialogStatusLogger status, KeePassLib.IDatabaseFormat databaseFormat) [0x00013] in <d9555282dea14061ab4400355adad9e4>:0
at keepass2android.Database.LoadData (keepass2android.IKp2aApp app, KeePassLib.Serialization.IOConnectionInfo iocInfo, System.IO.MemoryStream databaseData, KeePassLib.Keys.CompositeKey compositeKey, keepass2android.ProgressDialogStatusLogger status, KeePassLib.IDatabaseFormat databaseFormat) [0x00033] in <d9555282dea14061ab4400355adad9e4>:0
at keepass2android.Kp2aApp.LoadDatabase (KeePassLib.Serialization.IOConnectionInfo ioConnectionInfo, System.IO.MemoryStream memoryStream, KeePassLib.Keys.CompositeKey compositeKey, keepass2android.ProgressDialogStatusLogger statusLogger, KeePassLib.IDatabaseFormat databaseFormat, System.Boolean makeCurrent) [0x000b9] in <42483a0e42cb482da6be36caa63cd922>:0
at keepass2android.LoadDb.TryLoad (System.IO.MemoryStream databaseStream) [0x00021] in <d9555282dea14061ab4400355adad9e4>:0
at keepass2android.LoadDb.Run () [0x000ac] in <d9555282dea14061ab4400355adad9e4>:0
2019-10-14 12:54:19 PM:352 -- OnFinish message: An error occured: Specified argument was out of the range of valid values.
Parameter name: p.Memory

Context

  • Software
    • App version: 1.07-r1
    • Google Drive version: 2.19.392.02.40
    • Android version: 10
    • Build number: QP1A.191005.007
  • Hardware
    • Model: Pixel 3
    • Storage: 64 Gb

talbotfox avatar Oct 14 '19 21:10 talbotfox