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

Make a super-cool password reading library #27

Open
kirelagin opened this issue Jul 25, 2021 · 1 comment
Open

Make a super-cool password reading library #27

kirelagin opened this issue Jul 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@kirelagin
Copy link
Contributor

Apparently, reading a password is a very non-trivial task. There is POSIX getpass, but unfortunately it was deprecated, because, allegedly, it is very easy to implement it your self (LOL).

What we currently have kinda works, but it has the following problems:

  1. It keeps the original input encoding instead of normalising it to UTF-8, which means that the same sequence of key presses on OSes with different locale encodings (e.g. UTF-16 on Windows vs. UTF-8 on Linux) will result in different passwords as bytes. Pretty much every password reading function for C/C++ that I could find has this problem (in higher-level languages it is usually not a problem, since all input goes via a Unicode-aware string type and is then encoded to UTF-8 bytes).

  2. It does not do anything about signals. In reality, we want to handle signals and restore the terminal state, and then, if we were paused and resumed, we want to reset all our state and start reading from scratch.

This sounds like a useful C library to have in general.

@kirelagin kirelagin added the enhancement New feature or request label Jul 25, 2021
@kirelagin
Copy link
Contributor Author

openssl/openssl#3531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant