Issue #59 resolved

cannot use python-keyring and python-crypto together any more

chaica
created an issue

Hi,

Until now under GNU/Linux Debian Wheezy when I tried to use python keyring 0.7.1 with python-crypto everything was fine. But trying to upgrade to 0.8.1 I had the following issue while executing the example auth_demo.py:

{{{

sid2:/usr/share/doc/python-keyring/examples# python auth_demo.py Username: john Password:

Password file found in legacy location /root/crypted_pass.cfg and new location /root/.local/share/python_keyring/crypted_pass.cfg Old location will be ignored. Please input your password for the keyring Wrong password for the keyring. Traceback (most recent call last): File "auth_demo.py", line 56, in <module> main() File "auth_demo.py", line 50, in main keyring.set_password('auth_demo_login', username, password) File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 42, in set_password _keyring_backend.set_password(service_name, username, password) File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 328, in set_password password_encrypted = self.encrypt(password.encode('utf-8')) File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 471, in encrypt crypter = self._init_crypter() File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 459, in _init_crypter raise ValueError("Wrong password") ValueError: Wrong password }}}

It keeps telling me the message above even if I delete auth_demo.cfg just before.

If I remove python-crypto, everything is back to normal: {{{ Username: carl Password:

Authorization successful. sid2:/usr/share/doc/python-keyring/examples# python auth_demo.py Authorization successful. }}} In python-keyring 0.7.1 it was working with python-crypto very well. Bye, Carl Chenet

Comments (4)

  1. Anonymous

    Hi,

    Any news on that bug report? It's a blocker to create the new official Debian package of Python-keyring 0.8.1

    Bye, Carl Chenet

  2. Jason R. Coombs

    I agree this is something that should get fixed. I tried characterizing the problem this morning, but ran into other issues. Using the latest tip, I got the tests running with pycrypto installed, and I'm finding that even the tests aren't passing (test_encrypt_decrypt fails with a NotImplementedError).

    The implementation of the CryptedFileKeyring looks to be very rough around the edges. I'm going to try to clean it up, and I hope to have it working again.

  3. Jason R. Coombs

    auth_demo is once again working for me on the latest tip (69915bbcdc3f), using pycrypto 2.6:

    PS C:\Users\jaraco\projects\public\keyring\demo> python .\auth_demo.py
    Username:
    jaraco
    Password:
    
    Authorization successful.
    

    I am attaching an sdist suitable for easy_installing and testing.

    Please read the changelog for details on the changes. This upcoming release of 0.9.2 changes the format of the crypted_pass.cfg (as did 0.9.1), so be sure to back up your password file if you might want to roll back.

    Please re-open (or create a new ticket as appropriate) if you encounter any more issues.

    Thanks for the report.

  4. Log in to comment