plattfot / pinentry-rofi

Rofi frontend to pinentry
43 stars 5 forks source link

How to change Passphrase #17

Closed aastafiev closed 9 months ago

aastafiev commented 9 months ago

I've tryed to recompile with chaged 'Passphrase:' with no luck

plattfot commented 9 months ago

Hi, Sorry for the late replay.

Did you change the prompt on line 28 in the script?

That should work, but I cannot double check right now. I'll try that later tonight to verify.

Also make sure it is installed correctly and that the gpg config file is using it.

plattfot commented 9 months ago

After dusting off my knowledge about how gpg-agent works, changing the prompt on line 28 will just change the default prompt. Clients are still allowed to change the prompt using SETPROMPT <newprompt>. Which is what for example the gpg-agent is doing here when calling pinentry.

If you just want to have your prompt in your native language, I would think it will respect the locale and change the prompt to match the language specified.

Having a config file for pinentry-rofi where you can change the default prompt, ok and cancel button might be useful. I do sadly don't have the bandwidth for it right now, so pull requests are welcome.

aastafiev commented 9 months ago

Well, I couldn’t managed to change prompt from sources (28 line), because assaun protocol sends SETPROMPT request (as you already mentioned) and as I understand the prompt applies as is. Unfortunately, I couldn’t sort out how to change clients SETPROMT in gpg agent. After some investigation, I think the only way is to utilize, for example, PINENTRY_USER_DATA environment variable and parse it somewhere in your code. Or to add additional command line option. But, unfortunately, I’m not as good as you in scheme language. So, I’m doing simple trail code on Python to check this assumptions.


Sincerely yours, Aleksey Astafiev

On 16 Nov 2023, at 06:06, Fredrik Salomonsson @.***> wrote:

 After dusting off my knowledge about how gpg-agent works, changing the prompt on line 28 will just change the default prompt. Clients are still allowed to change the prompt using SETPROMPT . Which is what for example the gpg-agent is doing here when calling pinentry.

If you just want to have your prompt in your native language, I would think it will respect the locale and change the prompt to match the language specified.

Having a config file for pinentry-rofi where you can change the default prompt, ok and cancel button might be useful. I do sadly don't have the bandwidth for it right now, so pull requests are welcome.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

plattfot commented 9 months ago

Hi,

I checked the gnupg code and it will indeed respect your locale. So that is one way of changing the passphrase.

Parsing the PINENTRY_USER_DATA in pinentry-rofi to workaround it is out of scope for this project, sorry.

One way you could hack this would be to write a simple wrapper around pinentry-rofi in python (or any other language you are comfortable with) that just intercepts the SETPROMPT, change it to what you want and pass that along to pinentry-rofi. Then let the rest of the commands just pass by.

aastafiev commented 9 months ago

I see. Thank you, I’ve already finished my project https://github.com/aastafiev/pinentry-rofi


Sincerely yours, Aleksey Astafiev

On 18 Nov 2023, at 04:19, Fredrik Salomonsson @.***> wrote:

 Hi,

I checked the gnupg code and it will indeed respect your locale. So that is one way of changing the passphrase.

Parsing the PINENTRY_USER_DATA in pinentry-rofi to workaround it is out of scope for this project, sorry.

One way you could hack this would be to write a simple wrapper around pinentry-rofi in python (or any other language you are comfortable with) that just intercepts the SETPROMPT, change it to what you want and pass that along to pinentry-rofi. Then let the rest of the commands just pass by.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.