aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-07-29 16:02:52 +0200
committerAndreas Schneider <mail@cynapses.org>2009-07-29 16:02:52 +0200
commit6f47401173340665e25872bef0b87cedd9812602 (patch)
treee0c25e7379793101943b7aca57fff80fd6a6a1af
parentd247b86202f68170de6b5c2fb4e73ed16a621ed3 (diff)
downloadlibssh-6f47401173340665e25872bef0b87cedd9812602.tar.gz
libssh-6f47401173340665e25872bef0b87cedd9812602.tar.xz
libssh-6f47401173340665e25872bef0b87cedd9812602.zip
Fix SSH1 compilation.
-rw-r--r--libssh/auth.c6
-rw-r--r--libssh/auth1.c10
-rw-r--r--libssh/channels.c12
-rw-r--r--libssh/channels1.c4
-rw-r--r--libssh/options.c4
-rw-r--r--libssh/packet.c20
6 files changed, 30 insertions, 26 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 77d4d218..160d4397 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -208,7 +208,7 @@ int ssh_userauth_none(SSH_SESSION *session, const char *username) {
enter_function();
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (session->version == 1) {
ssh_userauth1_none(session, username);
leave_function();
@@ -314,7 +314,7 @@ int ssh_userauth_offer_pubkey(SSH_SESSION *session, const char *username,
enter_function();
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (session->version == 1) {
ssh_userauth1_offer_pubkey(session, username, type, publickey);
leave_function();
@@ -671,7 +671,7 @@ int ssh_userauth_password(SSH_SESSION *session, const char *username,
enter_function();
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (session->version == 1) {
rc = ssh_userauth1_password(session, username, password);
leave_function();
diff --git a/libssh/auth1.c b/libssh/auth1.c
index cf24ae17..2b9e66df 100644
--- a/libssh/auth1.c
+++ b/libssh/auth1.c
@@ -27,7 +27,7 @@
#include "libssh/priv.h"
#include "libssh/ssh1.h"
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
static int wait_auth1_status(SSH_SESSION *session) {
/* wait for a packet */
if (packet_read(session) != SSH_OK) {
@@ -138,7 +138,11 @@ int ssh_userauth_offer_pubkey(SSH_SESSION *session, char *username,int type, STR
*/
int ssh_userauth1_offer_pubkey(SSH_SESSION *session, const char *username,
int type, STRING *pubkey) {
- return SSH_AUTH_DENIED;
+ (void) session;
+ (void) username;
+ (void) type;
+ (void) pubkey;
+ return SSH_AUTH_DENIED;
}
/*
@@ -247,5 +251,5 @@ int ssh_userauth1_password(SSH_SESSION *session, const char *username,
return wait_auth1_status(session);
}
-#endif /* HAVE_SSH1 */
+#endif /* WITH_SSH1 */
/* vim: set ts=2 sw=2 et cindent: */
diff --git a/libssh/channels.c b/libssh/channels.c
index d637ee1c..684520c4 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -641,7 +641,7 @@ int channel_default_bufferize(CHANNEL *channel, void *data, int len,
* @see channel_request_exec()
*/
int channel_open_session(CHANNEL *channel) {
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (channel->session->version == 1) {
return channel_open_session1(channel);
}
@@ -885,7 +885,7 @@ int channel_write(CHANNEL *channel, const void *data, u32 len) {
return -1;
}
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (channel->version == 1) {
int rc = channel_write1(channel, data, len);
leave_function();
@@ -1088,7 +1088,7 @@ int channel_request_pty_size(CHANNEL *channel, const char *terminal,
int rc = SSH_ERROR;
enter_function();
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (channel->version==1) {
channel_request_pty_size1(channel,terminal, col, row);
leave_function();
@@ -1157,7 +1157,7 @@ int channel_change_pty_size(CHANNEL *channel, int cols, int rows) {
enter_function();
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (channel->version == 1) {
rc = channel_change_pty_size1(channel,cols,rows);
leave_function();
@@ -1193,7 +1193,7 @@ error:
* @returns SSH_SUCCESS on success, SSH_ERROR on error.
*/
int channel_request_shell(CHANNEL *channel) {
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (channel->version == 1) {
return channel_request_shell1(channel);
}
@@ -1312,7 +1312,7 @@ int channel_request_exec(CHANNEL *channel, const char *cmd) {
STRING *command = NULL;
int rc = SSH_ERROR;
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (channel->version == 1) {
return channel_request_exec1(channel, cmd);
}
diff --git a/libssh/channels1.c b/libssh/channels1.c
index 7042f09f..db8f6b60 100644
--- a/libssh/channels1.c
+++ b/libssh/channels1.c
@@ -29,7 +29,7 @@
#include "libssh/priv.h"
#include "libssh/ssh1.h"
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
/*
* This is a big hack. In fact, SSH1 doesn't make a clever use of channels.
@@ -301,5 +301,5 @@ int channel_write1(CHANNEL *channel, const void *data, int len) {
return origlen;
}
-#endif /* HAVE_SSH1 */
+#endif /* WITH_SSH1 */
/* vim: set ts=2 sw=2 et cindent: */
diff --git a/libssh/options.c b/libssh/options.c
index 7c0246ef..bbc985b6 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -60,7 +60,7 @@ SSH_OPTIONS *ssh_options_new(void) {
option->port=22; /* set the default port */
option->fd=-1;
option->ssh2allowed=1;
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
option->ssh1allowed=1;
#else
option->ssh1allowed=0;
@@ -830,7 +830,7 @@ int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv) {
int compress = 0;
int cont = 1;
int current = 0;
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
int ssh1 = 1;
#else
int ssh1 = 0;
diff --git a/libssh/packet.c b/libssh/packet.c
index 4feca067..4086b3ec 100644
--- a/libssh/packet.c
+++ b/libssh/packet.c
@@ -214,7 +214,7 @@ error:
return rc;
}
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
/* a slighty modified packet_read2() for SSH-1 protocol */
static int packet_read1(SSH_SESSION *session) {
void *packet = NULL;
@@ -363,11 +363,11 @@ error:
return rc;
}
-#endif /* HAVE_SSH1 */
+#endif /* WITH_SSH1 */
/* that's where i'd like C to be object ... */
int packet_read(SSH_SESSION *session) {
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (session->version == 1) {
return packet_read1(session);
}
@@ -580,7 +580,7 @@ error:
return rc; /* SSH_OK, AGAIN or ERROR */
}
-#endif /* HAVE_SSH1 */
+#endif /* WITH_SSH1 */
int packet_send(SSH_SESSION *session) {
#ifdef HAVE_SSH1
@@ -597,7 +597,7 @@ void packet_parse(SSH_SESSION *session) {
int type = session->in_packet.type;
u32 tmp;
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (session->version == 1) {
/* SSH-1 */
switch(type) {
@@ -622,7 +622,7 @@ void packet_parse(SSH_SESSION *session) {
}
return;
} else {
-#endif /* HAVE_SSH1 */
+#endif /* WITH_SSH1 */
switch(type) {
case SSH2_MSG_DISCONNECT:
buffer_get_u32(session->in_buffer, &tmp);
@@ -658,12 +658,12 @@ void packet_parse(SSH_SESSION *session) {
default:
ssh_log(session, SSH_LOG_RARE, "Received unhandled packet %d", type);
}
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
}
#endif
}
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
static int packet_wait1(SSH_SESSION *session, int type, int blocking) {
enter_function();
@@ -719,7 +719,7 @@ static int packet_wait1(SSH_SESSION *session, int type, int blocking) {
leave_function();
return SSH_OK;
}
-#endif /* HAVE_SSH1 */
+#endif /* WITH_SSH1 */
static int packet_wait2(SSH_SESSION *session, int type, int blocking) {
int rc = SSH_ERROR;
@@ -773,7 +773,7 @@ static int packet_wait2(SSH_SESSION *session, int type, int blocking) {
}
int packet_wait(SSH_SESSION *session, int type, int block) {
-#ifdef HAVE_SSH1
+#ifdef WITH_SSH1
if (session->version == 1) {
return packet_wait1(session, type, block);
}