diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-07-30 10:45:58 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-30 10:45:58 +0200 |
commit | 766bae9d7626bb596fc3b60d2cd5fe5a7fc356db (patch) | |
tree | ec6aa6d9ea44d8eea5c47a8d1245c4fbe2930d96 /libssh/auth.c | |
parent | 94a57df0c9eceda18679b2823de74837fb5a73c1 (diff) | |
download | libssh-766bae9d7626bb596fc3b60d2cd5fe5a7fc356db.tar.gz libssh-766bae9d7626bb596fc3b60d2cd5fe5a7fc356db.tar.xz libssh-766bae9d7626bb596fc3b60d2cd5fe5a7fc356db.zip |
Fix build with MSVC.
Diffstat (limited to 'libssh/auth.c')
-rw-r--r-- | libssh/auth.c | 20 |
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" |