UTF-8 password decoding should be supported on Windows
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
Hi, and thank you for your work!
Currently, `get_password` and `get_credential` on Windows assume passwords to be encoded in UTF-16. However, I have encountered more than one case where the bytes object was encoded in UTF-8 (possibly by another library) and keyring would crash with a `UnicodeDecodeError`.
I think there should be a way to let the user specify a different encoding, return the bytes object directly or just fall back to UTF-8 before throwing an error. I can work on a PR if this would be a welcome change.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Windows implementations of get_password and get_credential and trace where the returned bytes are decoded as UTF-16. Reproduce the UnicodeDecodeError with UTF-8-encoded bytes, then review the proposed choices for handling alternate encodings. Done means the chosen behavior is defined and UTF-8 input no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100