saturneric / GpgFrontend

A free, open-source, robust yet user-friendly, compact and cross-platform tool for OpenPGP encryption. It stands out as an exceptional GUI frontend for the modern GnuPG (gpg).
https://gpgfrontend.bktus.com
GNU General Public License v3.0
456 stars 43 forks source link

Windows : "general error" when creating new keys / Registry and environment usage #61

Closed Achim16 closed 1 year ago

Achim16 commented 2 years ago

Hi, firstly thanks for your great work on a modern GUI.

I face a "general error" when creating new keys and cannot import existing gpg keyrings. This happens on machines where also eg GNUPT/GPGShell are installed using GnuPG 1.x On a fresh VM with Win11 Gpgfrontend works fine, both installer version and portable.

It seems to be that , in case it does not exist, a new AppData\Roaming\gnupg\ is created. In my case, further to GPG 1.x also installed this already has gpg keyrings in it.

My suspicion is that GpgFrontend also makes use of registry entries gpgProgram and/or HomeDir. As in my case gpgProgram is point ing to gpg.exe 1.x this would maybe explain the general error.

May I therefore ask if there is any configuration file for GpgFrontend which allows to specify for keys and program a custom path to use ?

Thanks

Edit : found the logfile. Apparently the Frontend uses correctly gpg 2.3.6 coming with the App. So, no issue there. The error is coming here. I enclose the lofile.

ERROR gpg_err_code_t GpgFrontend::check_gpg_error_2_err_code(gpgme_error_t, gpgme_error_t) [ Error 1 ] Source: GPGME Description: General error 20220513T002002.log

saturneric commented 2 years ago

I read the logs and it shows that GpgFrontend is working properly. But the problem, I think, appears with gnupg. Could you try generating the key via the command line using the gnupg that comes with GpgFrontend and see if that works?

Achim16 commented 2 years ago

No, is does not. GPG complains about gpg.conf which the path its gets through registry entry gpgprogram in HKEY_CURRENT_USER\Software\GNU\GnuPG set by a GPG 1.x GUI. If I use e.g. gpg --generate-key --homedir b:\ it works. So, the question is, how can I get the Gpgfrontend to pass --homedir to gpg.exe . There does not seem to be a possibilty in gpgfrontend to define commandline arguments for gpg.exe in its settings.

saturneric commented 2 years ago

I get it. So, I will gradually add a control panel for gnupg in the next few releases. I actually wanted to do this a long time ago, but I was just too busy with work to delay it. GnuPG first checks the registry, and when it doesn't find one, it checks the relative path.

But at this moment(current version up to v2.0.8), it doesn't seem possible to specify homedir directly.

Achim16 commented 2 years ago

Thank you very much for considering. A good example of what can be done is the preferences in the old app GPGKeys as part of GPGShell for Windows.
You might want to label this thread as an 'enhancement' proposal.

saturneric commented 1 year ago

The control panel is under way.

saturneric commented 1 year ago

A tight control menu is released in version 2.1.0. It will be expanded in the future.