mirror of
https://github.com/QRouland/UTPass.git
synced 2025-06-24 22:42:28 +00:00
Fix build rnp for arm64
This commit is contained in:
@ -3,23 +3,38 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <gpg-error.h>
|
||||
#include <gpgme++/interfaces/passphraseprovider.h>
|
||||
extern "C" {
|
||||
#include <rnp/rnp.h>
|
||||
}
|
||||
|
||||
class TesTPassphraseProvider : public QObject, public GpgME::PassphraseProvider
|
||||
class TesTPassphraseProvider : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
explicit TesTPassphraseProvider(QObject * parent = nullptr)
|
||||
{}
|
||||
|
||||
public:
|
||||
char *getPassphrase(const char *useridHint,
|
||||
const char *description,
|
||||
bool previousWasBad,
|
||||
bool &canceled) override
|
||||
~TesTPassphraseProvider() = default;
|
||||
|
||||
static TesTPassphraseProvider& instance()
|
||||
{
|
||||
static TesTPassphraseProvider instance;
|
||||
return instance;
|
||||
}
|
||||
TesTPassphraseProvider(TesTPassphraseProvider const &) = delete;
|
||||
void operator=(TesTPassphraseProvider const &) = delete;
|
||||
|
||||
char *ret;
|
||||
gpgrt_asprintf(&ret, "%s", "utpasspassphrase");
|
||||
return ret;
|
||||
};
|
||||
|
||||
static bool
|
||||
example_pass_provider(rnp_ffi_t ffi,
|
||||
void * app_ctx,
|
||||
rnp_key_handle_t key,
|
||||
const char * pgp_context,
|
||||
char buf[],
|
||||
size_t buf_len)
|
||||
{ strncpy(buf, "utpasspassphrase", buf_len);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -70,7 +70,7 @@ void TestsUtils::copyFolder(QUrl sourceFolderUrl, QUrl destFolderUrl)
|
||||
|
||||
QObject *TestsUtils::getTestPassphraseProvider()
|
||||
{
|
||||
return this->m_passphrase_povider.get();
|
||||
return &TesTPassphraseProvider::instance();
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,9 +11,6 @@ class TestsUtils : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
std::unique_ptr<TesTPassphraseProvider> m_passphrase_povider;
|
||||
|
||||
public:
|
||||
TestsUtils();
|
||||
~TestsUtils() override = default;
|
||||
|
Reference in New Issue
Block a user