1
1
Этот коммит содержится в:
Andreas Schneider 2009-07-27 23:17:35 +02:00
родитель 81dab99afc
Коммит 1abdb28995
6 изменённых файлов: 30 добавлений и 26 удалений

Просмотреть файл

@ -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();

Просмотреть файл

@ -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, ssh
*/
int ssh_userauth1_offer_pubkey(SSH_SESSION *session, const char *username,
int type, ssh_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: */

Просмотреть файл

@ -643,7 +643,7 @@ int channel_default_bufferize(ssh_channel channel, void *data, int len,
* @see channel_request_exec()
*/
int channel_open_session(ssh_channel channel) {
#ifdef HAVE_SSH1
#ifdef WITH_SSH1
if (channel->session->version == 1) {
return channel_open_session1(channel);
}
@ -887,7 +887,7 @@ int channel_write(ssh_channel channel, const void *data, uint32_t len) {
return -1;
}
#ifdef HAVE_SSH1
#ifdef WITH_SSH1
if (channel->version == 1) {
int rc = channel_write1(channel, data, len);
leave_function();
@ -1090,7 +1090,7 @@ int channel_request_pty_size(ssh_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();
@ -1159,7 +1159,7 @@ int channel_change_pty_size(ssh_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();
@ -1195,7 +1195,7 @@ error:
* @returns SSH_SUCCESS on success, SSH_ERROR on error.
*/
int channel_request_shell(ssh_channel channel) {
#ifdef HAVE_SSH1
#ifdef WITH_SSH1
if (channel->version == 1) {
return channel_request_shell1(channel);
}
@ -1314,7 +1314,7 @@ int channel_request_exec(ssh_channel channel, const char *cmd) {
ssh_string command = NULL;
int rc = SSH_ERROR;
#ifdef HAVE_SSH1
#ifdef WITH_SSH1
if (channel->version == 1) {
return channel_request_exec1(channel, cmd);
}

Просмотреть файл

@ -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(ssh_channel channel, const void *data, int len) {
return origlen;
}
#endif /* HAVE_SSH1 */
#endif /* WITH_SSH1 */
/* vim: set ts=2 sw=2 et cindent: */

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 WITH_SSH1
@ -597,7 +597,7 @@ void packet_parse(SSH_SESSION *session) {
uint32_t type = session->in_packet.type;
uint32_t 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);
@ -664,12 +664,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();
@ -725,7 +725,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;
@ -782,7 +782,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);
}