]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/uxstore.c
Add have_ssh_host_key() and use it to influence algorithm selection.
[PuTTY.git] / unix / uxstore.c
index d97185e1efbcab674328d199efa549a2e6b4504d..411953ac1a6ff7bde8327beee7a50c9e1c81bdb7 100644 (file)
@@ -589,6 +589,16 @@ int verify_host_key(const char *hostname, int port,
     return ret;
 }
 
+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)
 {