Allow exporting secret keys.
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
This commit is contained in:
@@ -308,8 +308,6 @@ const Error GpgMEWorker::CreateSubKey(GpgME::Key& k,
|
||||
return e;
|
||||
}
|
||||
|
||||
#ifdef DEVTIME
|
||||
|
||||
const Error GpgMEWorker::ExportPrivateKey(const char * pattern, string& buffer,
|
||||
const string& passphrase)
|
||||
{
|
||||
@@ -324,14 +322,13 @@ const Error GpgMEWorker::ExportPrivateKey(const char * pattern, string& buffer,
|
||||
uint flags = Context::ExportSecret;
|
||||
|
||||
Error e = ctx->exportPublicKeys(pattern, kData, flags);
|
||||
buffer = kData.toString(); // Empty
|
||||
buffer = kData.toString();
|
||||
|
||||
delete ppp;
|
||||
delete ctx;
|
||||
|
||||
return e;
|
||||
}
|
||||
#endif
|
||||
|
||||
const Error GpgMEWorker::ExportPublicKey(const char* pattern, string& buffer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user