aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgKeyGetter.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-03 13:01:27 +0000
committersaturneric <[email protected]>2023-12-03 13:01:27 +0000
commitd0602f09564d3d200b20e83a977315134ced842e (patch)
treeb9cd6f429983a0c9bce51e7fb711b894d634601b /src/core/function/gpg/GpgKeyGetter.cpp
parentfeat: general improvements of aync execution and memory security (diff)
downloadGpgFrontend-d0602f09564d3d200b20e83a977315134ced842e.tar.gz
GpgFrontend-d0602f09564d3d200b20e83a977315134ced842e.zip
fix: slove issues in key/subkey generation
Diffstat (limited to 'src/core/function/gpg/GpgKeyGetter.cpp')
-rw-r--r--src/core/function/gpg/GpgKeyGetter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/function/gpg/GpgKeyGetter.cpp b/src/core/function/gpg/GpgKeyGetter.cpp
index 5215f34b..cad2d884 100644
--- a/src/core/function/gpg/GpgKeyGetter.cpp
+++ b/src/core/function/gpg/GpgKeyGetter.cpp
@@ -82,7 +82,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
auto keys_list = std::make_unique<GpgKeyLinkList>();
for (const auto& [key, value] : keys_cache_) {
- keys_list->push_back(value.Copy());
+ keys_list->push_back(value);
}
return keys_list;
}
@@ -140,7 +140,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
// get the lock
std::lock_guard<std::mutex> lock(ctx_mutex_);
auto keys_copy = std::make_unique<GpgKeyLinkList>();
- for (const auto& key : *keys) keys_copy->emplace_back(key.Copy());
+ for (const auto& key : *keys) keys_copy->emplace_back(key);
return keys_copy;
}
@@ -148,7 +148,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
// get the lock
std::lock_guard<std::mutex> lock(ctx_mutex_);
auto keys_copy = std::make_unique<KeyArgsList>();
- for (const auto& key : *keys) keys_copy->emplace_back(key.Copy());
+ for (const auto& key : *keys) keys_copy->emplace_back(key);
return keys_copy;
}
@@ -189,7 +189,7 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
if (keys_cache_.find(key_id) != keys_cache_.end()) {
std::lock_guard<std::mutex> lock(ctx_mutex_);
// return a copy of the key in cache
- return keys_cache_[key_id].Copy();
+ return keys_cache_[key_id];
}
// return a bad key