Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backslashes in password are not handled correctly #674

Open
lajonss opened this issue Apr 5, 2024 · 0 comments
Open

Backslashes in password are not handled correctly #674

lajonss opened this issue Apr 5, 2024 · 0 comments

Comments

@lajonss
Copy link

lajonss commented Apr 5, 2024

Describe the bug
Backslashes in password (e.g. encoded unicode characters) make the library behave incorrectly.

To Reproduce

~$ cat dupapassword
\u0142u\u017c
~$ keyring set dupaservice dupauser < dupapassword
~$ keyring get dupaservice dupauser

~$

Expected behavior
I guess backslashes should be supported, or an error should be reported when trying to set such password.

Environment

  • OS: DanctNIX (based on Arch Linux ARM) with Phosh (Gnome-ish DE)
$ pip list | grep keyring
keyring               25.0.0

$ keyring --list-backends
keyring.backends.libsecret.Keyring (priority: 4.8)
keyring.backends.kwallet.DBusKeyring (priority: 4.9)
keyring.backends.SecretService.Keyring (priority: 5)
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.chainer.ChainerBackend (priority: 10)

Additional context
I've stumbled upon this when using Numberstation with polish characters (ł, ż) entered as token names. Numberstation uses urllib.parse.urlencode and json.dumps to turn them into a password.

Python API returns empty string:

>>> keyring.get_password('dupaservice', 'dupauser') is None
False
>>> keyring.get_password('dupaservice', 'dupauser')
''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant