Cannot open password database ("Too many iterations: 86006. Aborting.")

Bug #1689784 reported by Joshua Randall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pasaffe
Fix Released
Undecided
Marc Deslauriers

Bug Description

I have a password database that I store in Google Drive. Until now I have used the Password Gorilla Tcl/Tk app and the passwdsafe Android app to access the password database. I'd like to switch to pasaffe now that I am on a GNOME system, but the current version of my password database is failing to load in pasaffe with the following error:

$ pasaffe -f /tmp/pwsafe.ps3
Traceback (most recent call last):
  File "/usr/bin/pasaffe", line 46, in <module>
    pasaffe.main()
  File "/usr/lib/python3/dist-packages/pasaffe/__init__.py", line 69, in main
    window = PasaffeWindow.PasaffeWindow(database=options.filename)
  File "/usr/lib/python3/dist-packages/pasaffe/PasaffeWindow.py", line 64, in __new__
    new_object.finish_initializing(builder, database)
  File "/usr/lib/python3/dist-packages/pasaffe/PasaffeWindow.py", line 105, in finish_initializing
    success = self.fetch_password()
  File "/usr/lib/python3/dist-packages/pasaffe/PasaffeWindow.py", line 183, in fetch_password
    self.passfile = PassSafeFile(self.database, password)
  File "/usr/lib/python3/dist-packages/pasaffe_lib/readdb.py", line 75, in __init__
    self.readfile(filename, password, fixup=fixup)
  File "/usr/lib/python3/dist-packages/pasaffe_lib/readdb.py", line 90, in readfile
    self._readkeys(password)
  File "/usr/lib/python3/dist-packages/pasaffe_lib/readdb.py", line 542, in _readkeys
    self.keys['ITER'])
RuntimeError: Too many iterations: 86006. Aborting.

I have confirmed that the same /tmp/pwsafe.ps3 file is able to be opened by password-gorilla, so the issue seems to be specific to pasaffe.

description: updated
description: updated
Revision history for this message
Joshua Randall (jcrandall) wrote :

I've now checked the other two python implementations of pwsafe and can report that both Loxodo (http://www.christoph-sommer.de/loxodo/) and pwpwsafe (https://github.com/ronys/pypwsafe) can decrypt my password database without issues.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Hi, thanks for reporting this issue.

What application did you initially use to create your password file? Did you manually change the number of iterations on the password hash?

The default number of iterations is 2048, it looks like your file has 86006 iterations. Pasaffe has a limit of 50000 iterations just so that a malformed password file doesn't cause it to hang.

I guess I could bump up that number.

As a workaround until I release a new version, you can edit /usr/lib/python3/dist-packages/pasaffe_lib/readdb.py as root and change the maximum from 50000 to 500000 around line 540.

Changed in pasaffe:
status: New → Confirmed
assignee: nobody → Marc Deslauriers (mdeslaur)
Changed in pasaffe:
status: Confirmed → Fix Committed
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Fix is now in artful, and in the PPA. Thanks!

Changed in pasaffe:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.