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

fix rbw-pinentry-keyring not saving passwords correctly and not working with 2fa codes and add auto setup #178

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

HenkVanMaanen
Copy link
Contributor

@HenkVanMaanen HenkVanMaanen commented May 29, 2024

This PR solves 3 things:

the rbw-pinentry-keyring setup command did not support passwords that includes a space. The cut command only retrieved the first word of the password and thus skipping the other words. cut -c3- cuts from the 3rd char 'D ' to the end of the line.

So pinentry output like D this is a passphrase will be cut to this is a passphrase.

Can be tested with the following commands:

old: echo "D this is a passphrase" | cut -d' ' -f2
new: echo "D this is a passphrase" | cut -c3-

Also the script doesnt work with 2fa codes because the secret-tool is called for the 2fa code instead of the system pinentry. This PR also fixes that bug.

This PR also removes the setup command and it will auto setup if the password is not found in the keyring. Also there is a new command added: clear, with this command the password can be cleared from the keyring in case it needs to be updated or removed.

the rbw-pinentry-keyring setup command did not support passwords that includes a space. The cut command only retrieved the first word of the password and thus skipping the other words. `cut -c3-` cuts from the 3rd char 'D ' to the end of the line. 

So pinentry output like 'D this is a passphrase' will be cut to 'this is a passphrase'.
When rbw needs to ask for the 2fa code, the script would get the master password instead of asking the 2fa code. This commit fixes that, it checks if the prompt is "Master Password", if it's different, it passes the pinentry commands to the system pinentry.
@HenkVanMaanen HenkVanMaanen changed the title fix rbw-pinentry-keyring not saving passwords correctly fix rbw-pinentry-keyring not saving passwords correctly and not working with 2fa codes May 29, 2024
this commit removes the need to run the setup command manually. If the master password isn't in the keyring yet, the script will ask the user via pinentry and saves the password in the keyring.
@HenkVanMaanen HenkVanMaanen changed the title fix rbw-pinentry-keyring not saving passwords correctly and not working with 2fa codes fix rbw-pinentry-keyring not saving passwords correctly and not working with 2fa codes and add auto setup May 29, 2024
@doy doy merged commit ce852fd into doy:main Jun 19, 2024
8 checks passed
@doy
Copy link
Owner

doy commented Jun 19, 2024

thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants