Using a workaround that validates passphrase for a secret key.
With GnuPG 2.2.23 and GpgME 1.1.15, a secret key can be exported when the right
passphrase is provided. With a bad passphrase, application crashes.
See https://dev.gnupg.org/T5151
Application may validate a passphrase before invoking engine. Until it is
hopefully fixed in upstream and available in mainstream.
Requests the passphrase with a popup.
As from GPGME 1.15.0, the loopback pinentry is functional when exporting secret keys. It works fine when the exact passphrase is provided. If it's a wrong passphrase, GPGME does not generate an ::Error, but the app crashes with 'free(): double free detected in tcache 2'.
Hence, this patch cannot be committed to master.
Status : dangerous
Result : works and works not
Reason : a wrong passphrase means a crash