Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Too many iterations causing pythonista to crash (lastpass module/simple-pbkdf2)
-
I am trying to get the lastpass-python module working on Pythonista but it keeps on crashing Pythonista. I traced the issue down to when it tries to create a binary digest on line 124 in fetcher.py, it seems to start executing that line and then crashes. I'm guessing Pythonista has an issue storing binary data, is that a possibility?
(Obviously I downloaded all the requirements -
simple-pbkdf2
andmock
.)Edit: here's example code to execute in the console which will crash the app.
-
Ok I figured out the exact point of crash. When simple-pbkdf2 is creating the binary digest it iterates using the given iteration parameter. See here. Now, lastpass's "API" returns an iteration count which must be used to create the digest. However, if the iteration is greater than ~4800 then simple-pbkdf2 crashes Pythonista while iterating (runs out of memory? - I'm on iPhone 5 7.0.x). I tested with an iteration count of <=4700 and it works fine. Is there any way that this can be fixed, Ole? Or is it a hardware limitation?
Thanks! -
It seems like
simple-pbkdf2
is causing a stack overflow somewhere infunctools
. There isn't much I can do about this, but I can suggest a workaround for what you're trying to do.I've modified
fetcher.py
to work with thepbkdf2
1.3 module instead ofsimple-pbkdf2
. Here's my modified version: https://gist.github.com/omz/ba1ed16ab1b728dbde6dSimply replace
pbkdf2.py
with the version from thepbkdf2
1.3 module and replacefetcher.py
with the contents of my gist above (you may need to restart Pythonista in case the old modules are still cached).I've been able to get it to work this way, hope it helps.
-
Awesome! It works! Thanks so much! Now I have to work on parsing and importing it into the
keychain
.