summaryrefslogtreecommitdiffstats
path: root/libssh/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/auth.c')
-rw-r--r--libssh/auth.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 22840a3..96b4110 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -750,6 +750,22 @@ error:
return rc;
}
+#ifdef _MSC_VER
+static const char privKey_1[] = "%s/.ssh/identity";
+static const char pubKey_1[] = "%s/.ssh/identity.pub";
+static const char privKey_2[] = "%s/.ssh/id_dsa";
+static const char pubKey_2[] = "%s/.ssh/id_dsa.pub";
+static const char privKey_3[] = "%s/.ssh/id_rsa";
+static const char pubKey_3[] = "%s/.ssh/id_rsa.pub";
+/** Used different var to allow const char[] declaration */
+static struct ssh_keys_struct keytab[] = {
+ { privKey_1, pubKey_1},
+ { privKey_2, pubKey_2},
+ { privKey_3, pubKey_3},
+ {0}
+};
+#else
+/* This requires GCC extensions */
static struct ssh_keys_struct keytab[] = {
{
.privatekey = "%s/.ssh/identity",
@@ -768,9 +784,7 @@ static struct ssh_keys_struct keytab[] = {
.publickey = NULL
}
};
-
-/* this function initialy was in the client */
-/* but the fools are the ones who never change mind */
+#endif
/**
* @brief Tries to automaticaly authenticate with public key and "none"