zalando / go-keyring

Cross-platform keyring interface for Go
MIT License
811 stars 82 forks source link

Umlaut passwords fail to decode correctly on MacOS #61

Closed ghost closed 2 years ago

ghost commented 2 years ago

https://github.com/zalando/go-keyring/pull/60 adds a test case for this. I'm unsure how this should be fixed correctly while maintaining the best possible backward compatibility. Options that came to mind:

I happily implement but would request some guidance on which direction it should be.

mikkeloscar commented 2 years ago

simply encode all passwords on MacOS

This seems to me the simplest solution. I would add some kind of prefix to the password e.g. encoded: such that you know whether to decode it or not when getting the password from the store. This would ensure that passwords stored before this change could still be read from the store without any issues (e.g. those would not be decoded).

ghost commented 2 years ago

The encoding on newline was already there. I just made it the default for all passwords and pushed the change to #60, which needs approval for the full tests to be run.

ghost commented 2 years ago

fixed in #60