Index: lib/ssh.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/ssh.c,v
retrieving revision 1.72
diff -u -r1.72 ssh.c
--- lib/ssh.c	30 Aug 2007 23:03:59 -0000	1.72
+++ lib/ssh.c	18 Sep 2007 12:46:51 -0000
@@ -407,6 +407,12 @@
           sshc->rsa_pub = aprintf("%s", data->set.str[STRING_SSH_PUBLIC_KEY]);
         else if (home)
           sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home);
+        else {
+          state(conn, SSH_SESSION_FREE);
+          sshc->actualCode = CURLE_COULDNT_READ_LOCAL_FILE;
+          failf(conn->data, "no public key found to use");
+          break;
+        }
 
         if (sshc->rsa_pub == NULL) {
           Curl_safefree(home);
@@ -420,6 +426,12 @@
           sshc->rsa = aprintf("%s", data->set.str[STRING_SSH_PRIVATE_KEY]);
         else if (home)
           sshc->rsa = aprintf("%s/.ssh/id_dsa", home);
+        else {
+          state(conn, SSH_SESSION_FREE);
+          sshc->actualCode = CURLE_COULDNT_READ_LOCAL_FILE;
+          failf(conn->data, "no private key found to use");
+          break;
+        }
 
         if (sshc->rsa == NULL) {
           Curl_safefree(home);
Index: include/curl/curl.h
===================================================================
RCS file: /cvsroot/curl/curl/include/curl/curl.h,v
retrieving revision 1.324
diff -u -r1.324 curl.h
--- include/curl/curl.h	31 Aug 2007 19:36:33 -0000	1.324
+++ include/curl/curl.h	18 Sep 2007 12:46:52 -0000
@@ -353,7 +353,7 @@
   CURLE_HTTP_POST_ERROR,         /* 34 */
   CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
   CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */
-  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
+  CURLE_COULDNT_READ_LOCAL_FILE, /* 37 */
   CURLE_LDAP_CANNOT_BIND,        /* 38 */
   CURLE_LDAP_SEARCH_FAILED,      /* 39 */
   CURLE_OBSOLETE40,              /* 40 - NOT USED */
@@ -418,6 +418,9 @@
 /* Backwards compatibility with older names */
 /* These are scheduled to disappear by 2009 */
 
+/* The following were added in 7.17.1 */
+#define CURLE_FILE_COULDNT_READ_FILE CURLE_COULDNT_READ_LOCAL_FILE
+
 /* The following were added in 7.17.0 */
 #define CURLE_OBSOLETE CURLE_OBSOLETE50	/* noone should be using this! */
 #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
