aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgAssuanHelper.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-30 19:48:18 +0000
committersaturneric <[email protected]>2025-04-30 19:48:18 +0000
commit9350d01d27577327de57ca4941da4aa0fb9fee70 (patch)
tree77cbc1ee8ea559b18b1cbef8e0b6f17e70866d06 /src/core/function/gpg/GpgAssuanHelper.h
parentMerge remote-tracking branch 'github/main' into develop (diff)
downloadGpgFrontend-9350d01d27577327de57ca4941da4aa0fb9fee70.tar.gz
GpgFrontend-9350d01d27577327de57ca4941da4aa0fb9fee70.zip
refactor: avoid directly using libassuan
Diffstat (limited to 'src/core/function/gpg/GpgAssuanHelper.h')
-rw-r--r--src/core/function/gpg/GpgAssuanHelper.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/core/function/gpg/GpgAssuanHelper.h b/src/core/function/gpg/GpgAssuanHelper.h
index f357ed93..b2a7f2b7 100644
--- a/src/core/function/gpg/GpgAssuanHelper.h
+++ b/src/core/function/gpg/GpgAssuanHelper.h
@@ -28,8 +28,6 @@
#pragma once
-#include <assuan.h>
-
#include "core/function/gpg/GpgContext.h"
namespace GpgFrontend {
@@ -49,17 +47,17 @@ class GPGFRONTEND_CORE_EXPORT GpgAssuanHelper
struct AssuanCallbackContext {
GpgAssuanHelper* self;
GpgComponentType component_type;
- assuan_context_t ctx;
+ gpgme_ctx_t ctx;
QByteArray buffer;
QString status;
- QString inquery;
+ QString status_args;
+ QString inquery_name;
+ QString inquery_args;
DataCallback data_cb;
InqueryCallback inquery_cb;
StatusCallback status_cb;
-
- [[nodiscard]] auto SendData(const QByteArray& b) const -> gpg_error_t;
};
/**
@@ -127,10 +125,8 @@ class GPGFRONTEND_CORE_EXPORT GpgAssuanHelper
private:
GpgContext& ctx_ =
GpgContext::GetInstance(SingletonFunctionObject::GetChannel());
- QMap<GpgComponentType, QSharedPointer<struct assuan_context_s>> assuan_ctx_;
- QByteArray temp_data_;
- QString temp_status_;
+ QMap<GpgComponentType, QSharedPointer<struct gpgme_context>> ctx_map_;
QString gpgconf_path_;
/**
@@ -177,8 +173,8 @@ class GPGFRONTEND_CORE_EXPORT GpgAssuanHelper
* @param status
* @return gpgme_error_t
*/
- static auto default_status_callback(void* opaque,
- const char* status) -> gpgme_error_t;
+ static auto default_status_callback(void* opaque, const char* status,
+ const char* args) -> gpgme_error_t;
/**
* @brief
@@ -187,8 +183,9 @@ class GPGFRONTEND_CORE_EXPORT GpgAssuanHelper
* @param inquery
* @return gpgme_error_t
*/
- static auto default_inquery_callback(void* opaque,
- const char* inquery) -> gpgme_error_t;
+ static auto default_inquery_callback(void* opaque, const char* name,
+ const char* args, gpgme_data_t* r_data)
+ -> gpgme_error_t;
};
}; // namespace GpgFrontend \ No newline at end of file