]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winstore.c
Add have_ssh_host_key() and use it to influence algorithm selection.
[PuTTY.git] / windows / winstore.c
index b1058832e99a11da3e48d44216a555da809aca07..c45b9b0419832d1cb91de16c97c8a05fedfe3232 100644 (file)
@@ -454,6 +454,16 @@ int verify_host_key(const char *hostname, int port,
        return 0;                      /* key matched OK in registry */
 }
 
+int have_ssh_host_key(const char *hostname, int port,
+                     const char *keytype)
+{
+    /*
+     * If we have a host key, verify_host_key will return 0 or 2.
+     * If we don't have one, it'll return 1.
+     */
+    return verify_host_key(hostname, port, keytype, "") != 1;
+}
+
 void store_host_key(const char *hostname, int port,
                    const char *keytype, const char *key)
 {