tannercollin / standardnotes-fs

Mount your Standard Notes as a filesystem.
GNU General Public License v3.0
148 stars 12 forks source link

can't login #5

Closed dddw closed 6 years ago

dddw commented 6 years ago

I tried setting this up, with sudo I get the following error. I installed with pip3 instead of pip by the way, and with sudo method.

Traceback (most recent call last): File "/usr/bin/snfs", line 11, in <module> sys.exit(main()) File "/usr/lib/python3.6/site-packages/standardnotes_fs/standardnotes_fs.py", line 143, in main keys = sn_api.gen_keys(password) File "/usr/lib/python3.6/site-packages/standardnotes_fs/api.py", line 38, in gen_keys password, pw_info['pw_salt'], pw_info['pw_cost']) File "/usr/lib/python3.6/site-packages/standardnotes_fs/crypt.py", line 24, in pure_generate_password_and_key 'sha512', password.encode(), pw_salt.encode(), pw_cost, AttributeError: 'NoneType' object has no attribute 'encode'

moughxyz commented 6 years ago

@tannercollin I don't believe this supports the 003 account type yet? The only change should be that the pw_salt is now computed client side rather than being retrieved from the server. The server returns pw_nonce instead, and the client computes

pw_salt = SHA256:Hexdigest([email, "SF", version, pw_cost, pw_nonce].join(":"))

and uses that to proceed with login as usual.

tannercollin commented 6 years ago

@mobitar yeah, this is probably the problem. I'll give it a shot, thanks!

tannercollin commented 6 years ago

Fixed in 18d5cb80381922d5aed2582ccd5c93a78e0401b0. Thanks for the bug report @dddw!

I'll push this to PyPi once it's tested better. For now, can you please back your notes up and install with: sudo pip install git+https://github.com/tannercollin/standardnotes-fs or sudo pip3 install git+https://github.com/tannercollin/standardnotes-fs