Files
k7/GpgMECWorker.h
SET 82b8810f62 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
2020-11-20 22:41:29 +01:00

40 lines
802 B
C++

/*
* File: GpgMECWorker.h
* Author: SET - nmset@yandex.com
* License : LGPL v2.1
* Copyright SET - © 2019
*
* Created on 14 octobre 2019, 15:22
*/
#ifndef GPGMECWORKER_H
#define GPGMECWORKER_H
#include <gpgme.h>
#include <gpgme++/error.h>
class GpgMECWorker
{
public:
GpgMECWorker();
virtual ~GpgMECWorker();
/**
* Deleting keys must be done with the C API because
* gpgmepp does not provide a way to use GPGME_DELETE_FORCE,
* resulting in a confirmation dialog triggered by GPG.
* This does not fit use on a web server.
* @param fpr
* @param secret delete secret key ?
* @param e
* @return
*/
bool DeleteKey(const char * fpr, bool secret, GpgME::Error& e);
private:
gpgme_ctx_t c_ctx;
};
#endif /* GPGMECWORKER_H */