chiark / gitweb /
g10: Skip signing keys where no secret key is available.
[gnupg2.git] / g10 / getkey.c
index 961d7de226f979f009f5d744f3c4a81195acdaa6..bb31dfbe0b17da8c174d9f6e6d379670f57327d9 100644 (file)
@@ -3529,6 +3529,13 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
              continue;
            }
 
+         if ((req_usage & PUBKEY_USAGE_SIG) && agent_probe_secret_key (NULL, pk))
+           {
+             if (DBG_LOOKUP)
+               log_debug ("\tno secret key for signing\n");
+             continue;
+           }
+
          if (DBG_LOOKUP)
            log_debug ("\tsubkey might be fine\n");
          /* In case a key has a timestamp of 0 set, we make sure