aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/function/gpg')
-rw-r--r--src/core/function/gpg/GpgContext.cpp6
-rw-r--r--src/core/function/gpg/GpgKeyImportExporter.h2
-rw-r--r--src/core/function/gpg/GpgKeyManager.cpp5
3 files changed, 6 insertions, 7 deletions
diff --git a/src/core/function/gpg/GpgContext.cpp b/src/core/function/gpg/GpgContext.cpp
index 0477b00a..443c139b 100644
--- a/src/core/function/gpg/GpgContext.cpp
+++ b/src/core/function/gpg/GpgContext.cpp
@@ -32,12 +32,12 @@
#include <gpgme.h>
#include <cassert>
+#include <mutex>
#include "core/function/CoreSignalStation.h"
#include "core/function/basic/GpgFunctionObject.h"
#include "core/module/ModuleManager.h"
#include "core/utils/GpgUtils.h"
-#include "spdlog/spdlog.h"
#include "utils/MemoryUtils.h"
#ifdef _WIN32
@@ -158,6 +158,8 @@ class GpgContext::Impl : public SingletonFunctionObject<GpgContext::Impl> {
gpgme_ctx_t ctx_ref_ = nullptr; ///<
gpgme_ctx_t binary_ctx_ref_ = nullptr; ///<
bool good_ = true;
+ std::mutex ctx_ref_lock_;
+ std::mutex binary_ctx_ref_lock_;
static auto set_ctx_key_list_mode(const gpgme_ctx_t &ctx) -> bool {
assert(ctx != nullptr);
@@ -205,6 +207,8 @@ class GpgContext::Impl : public SingletonFunctionObject<GpgContext::Impl> {
assert(CheckGpgError(err) == GPG_ERR_NO_ERROR);
return CheckGpgError(err) == GPG_ERR_NO_ERROR;
+
+ return true;
}
auto common_ctx_initialize(const gpgme_ctx_t &ctx,
diff --git a/src/core/function/gpg/GpgKeyImportExporter.h b/src/core/function/gpg/GpgKeyImportExporter.h
index 20eacd71..3c88c2c5 100644
--- a/src/core/function/gpg/GpgKeyImportExporter.h
+++ b/src/core/function/gpg/GpgKeyImportExporter.h
@@ -100,7 +100,7 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter
* @param inBuffer
* @return GpgImportInformation
*/
- auto ImportKey(StdBypeArrayPtr inBuffer) -> GpgImportInformation;
+ auto ImportKey(StdBypeArrayPtr) -> GpgImportInformation;
/**
* @brief
diff --git a/src/core/function/gpg/GpgKeyManager.cpp b/src/core/function/gpg/GpgKeyManager.cpp
index 4a67a3f4..7afc356a 100644
--- a/src/core/function/gpg/GpgKeyManager.cpp
+++ b/src/core/function/gpg/GpgKeyManager.cpp
@@ -184,11 +184,6 @@ auto GpgFrontend::GpgKeyManager::SetOwnerTrustLevel(const GpgKey& key,
auto err = gpgme_op_interact(
ctx_.DefaultContext(), static_cast<gpgme_key_t>(key), 0,
GpgKeyManager::interactor_cb_fnc, (void*)&handel_struct, data_out);
- if (err != GPG_ERR_NO_ERROR) {
- SPDLOG_ERROR("fail to set owner trust level {} to key {}, err: {}",
- trust_level, key.GetId(), gpgme_strerror(err));
- }
-
return CheckGpgError(err) == GPG_ERR_NO_ERROR && handel_struct.Success();
}