aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgKeyGetter.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-19 01:39:02 +0000
committersaturneric <[email protected]>2025-04-19 02:17:36 +0000
commitbe1f218314242fdf7c0fac76d32e2b9f16b5b6fe (patch)
tree2a56f13ca42170fab7837d03921155f621ad764b /src/core/function/gpg/GpgKeyGetter.cpp
parentfix: find pinentry under /app/bin in flatpak container (diff)
downloadGpgFrontend-be1f218314242fdf7c0fac76d32e2b9f16b5b6fe.tar.gz
GpgFrontend-be1f218314242fdf7c0fac76d32e2b9f16b5b6fe.zip
fix: find out adsk problem of flatpak
Diffstat (limited to 'src/core/function/gpg/GpgKeyGetter.cpp')
-rw-r--r--src/core/function/gpg/GpgKeyGetter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/function/gpg/GpgKeyGetter.cpp b/src/core/function/gpg/GpgKeyGetter.cpp
index 3419c18d..9fb0f6db 100644
--- a/src/core/function/gpg/GpgKeyGetter.cpp
+++ b/src/core/function/gpg/GpgKeyGetter.cpp
@@ -46,6 +46,8 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
// find in cache first
if (cache) {
auto key = get_key_in_cache(key_id);
+ assert(key->KeyType() == GpgAbstractKeyType::kGPG_KEY);
+
if (key != nullptr) return qSharedPointerDynamicCast<GpgKey>(key);
LOG_W() << "get gpg key" << key_id
@@ -164,6 +166,10 @@ class GpgKeyGetter::Impl : public SingletonFunctionObject<GpgKeyGetter::Impl> {
for (const auto& s_key : g_key->SubKeys()) {
if (s_key.ID() == g_key->ID()) continue;
auto p_s_key = QSharedPointer<GpgSubKey>::create(s_key);
+
+ // don't add adsk key or it will cause bugs
+ if (p_s_key->IsADSK()) continue;
+
keys_search_cache_.insert(s_key.ID(), p_s_key);
keys_search_cache_.insert(s_key.Fingerprint(), p_s_key);
}