diff options
author | saturneric <[email protected]> | 2023-12-03 13:01:27 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-03 13:01:27 +0000 |
commit | d0602f09564d3d200b20e83a977315134ced842e (patch) | |
tree | b9cd6f429983a0c9bce51e7fb711b894d634601b /src/core/function/gpg/GpgKeyGetter.cpp | |
parent | feat: general improvements of aync execution and memory security (diff) | |
download | GpgFrontend-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.cpp | 8 |
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 |