mirror of
https://github.com/clearml/dropbear
synced 2025-06-25 17:47:02 +00:00
Fixed compilation with unset ENABLE_{SVR,CLI}_AGENTFWD.
Got rid of ENABLE_AGENTFWD macro.
This commit is contained in:
parent
49b79fa02d
commit
d4a14fcb3d
17
agentfwd.h
17
agentfwd.h
@ -30,22 +30,19 @@
|
|||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_CLI_AGENTFWD
|
||||||
|
|
||||||
/* An agent reply can be reasonably large, as it can
|
/* An agent reply can be reasonably large, as it can
|
||||||
* contain a list of all public keys held by the agent.
|
* contain a list of all public keys held by the agent.
|
||||||
* 10000 is arbitrary */
|
* 10000 is arbitrary */
|
||||||
#define MAX_AGENT_REPLY 10000
|
#define MAX_AGENT_REPLY 10000
|
||||||
|
|
||||||
int svr_agentreq(struct ChanSess * chansess);
|
|
||||||
void svr_agentcleanup(struct ChanSess * chansess);
|
|
||||||
void svr_agentset(struct ChanSess *chansess);
|
|
||||||
|
|
||||||
/* client functions */
|
/* client functions */
|
||||||
void cli_load_agent_keys(m_list * ret_list);
|
void cli_load_agent_keys(m_list * ret_list);
|
||||||
void agent_buf_sign(buffer *sigblob, sign_key *key,
|
void agent_buf_sign(buffer *sigblob, sign_key *key,
|
||||||
const unsigned char *data, unsigned int len);
|
const unsigned char *data, unsigned int len);
|
||||||
void cli_setup_agent(struct Channel *channel);
|
void cli_setup_agent(struct Channel *channel);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __hpux
|
#ifdef __hpux
|
||||||
#define seteuid(a) setresuid(-1, (a), -1)
|
#define seteuid(a) setresuid(-1, (a), -1)
|
||||||
#define setegid(a) setresgid(-1, (a), -1)
|
#define setegid(a) setresgid(-1, (a), -1)
|
||||||
@ -53,4 +50,14 @@ void cli_setup_agent(struct Channel *channel);
|
|||||||
|
|
||||||
extern const struct ChanType cli_chan_agent;
|
extern const struct ChanType cli_chan_agent;
|
||||||
|
|
||||||
|
#endif /* ENABLE_CLI_AGENTFWD */
|
||||||
|
|
||||||
|
#ifdef ENABLE_SVR_AGENTFWD
|
||||||
|
|
||||||
|
int svr_agentreq(struct ChanSess * chansess);
|
||||||
|
void svr_agentcleanup(struct ChanSess * chansess);
|
||||||
|
void svr_agentset(struct ChanSess *chansess);
|
||||||
|
|
||||||
|
#endif /* ENABLE_SVR_AGENTFWD */
|
||||||
|
|
||||||
#endif /* _AGENTFWD_H_ */
|
#endif /* _AGENTFWD_H_ */
|
||||||
|
@ -123,6 +123,7 @@ void recv_msg_userauth_pk_ok() {
|
|||||||
void cli_buf_put_sign(buffer* buf, sign_key *key, int type,
|
void cli_buf_put_sign(buffer* buf, sign_key *key, int type,
|
||||||
const unsigned char *data, unsigned int len)
|
const unsigned char *data, unsigned int len)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_CLI_AGENTFWD
|
||||||
if (key->source == SIGNKEY_SOURCE_AGENT) {
|
if (key->source == SIGNKEY_SOURCE_AGENT) {
|
||||||
/* Format the agent signature ourselves, as buf_put_sign would. */
|
/* Format the agent signature ourselves, as buf_put_sign would. */
|
||||||
buffer *sigblob;
|
buffer *sigblob;
|
||||||
@ -134,8 +135,11 @@ void cli_buf_put_sign(buffer* buf, sign_key *key, int type,
|
|||||||
|
|
||||||
buf_free(sigblob);
|
buf_free(sigblob);
|
||||||
} else {
|
} else {
|
||||||
|
#endif
|
||||||
buf_put_sign(buf, key, type, data, len);
|
buf_put_sign(buf, key, type, data, len);
|
||||||
|
#ifdef ENABLE_CLI_AGENTFWD
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,11 +191,13 @@ int cli_auth_pubkey() {
|
|||||||
|
|
||||||
TRACE(("enter cli_auth_pubkey"))
|
TRACE(("enter cli_auth_pubkey"))
|
||||||
|
|
||||||
|
#ifdef ENABLE_CLI_AGENTFWD
|
||||||
if (!cli_opts.agent_keys_loaded) {
|
if (!cli_opts.agent_keys_loaded) {
|
||||||
/* get the list of available keys from the agent */
|
/* get the list of available keys from the agent */
|
||||||
cli_load_agent_keys(cli_opts.privkeys);
|
cli_load_agent_keys(cli_opts.privkeys);
|
||||||
cli_opts.agent_keys_loaded = 1;
|
cli_opts.agent_keys_loaded = 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (cli_opts.privkeys->first) {
|
if (cli_opts.privkeys->first) {
|
||||||
sign_key * key = (sign_key*)cli_opts.privkeys->first->item;
|
sign_key * key = (sign_key*)cli_opts.privkeys->first->item;
|
||||||
|
@ -143,7 +143,7 @@ int svr_add_pubkey_options(buffer *options_buf, int line_num, const char* filena
|
|||||||
ses.authstate.pubkey_options->no_port_forwarding_flag = 1;
|
ses.authstate.pubkey_options->no_port_forwarding_flag = 1;
|
||||||
goto next_option;
|
goto next_option;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_AGENTFWD
|
#ifdef ENABLE_SVR_AGENTFWD
|
||||||
if (match_option(options_buf, "no-agent-forwarding") == DROPBEAR_SUCCESS) {
|
if (match_option(options_buf, "no-agent-forwarding") == DROPBEAR_SUCCESS) {
|
||||||
dropbear_log(LOG_WARNING, "Agent forwarding disabled.");
|
dropbear_log(LOG_WARNING, "Agent forwarding disabled.");
|
||||||
ses.authstate.pubkey_options->no_agent_forwarding_flag = 1;
|
ses.authstate.pubkey_options->no_agent_forwarding_flag = 1;
|
||||||
|
@ -243,7 +243,7 @@ static int newchansess(struct Channel *channel) {
|
|||||||
chansess->x11authcookie = NULL;
|
chansess->x11authcookie = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_AGENTFWD
|
#ifdef ENABLE_SVR_AGENTFWD
|
||||||
chansess->agentlistener = NULL;
|
chansess->agentlistener = NULL;
|
||||||
chansess->agentfile = NULL;
|
chansess->agentfile = NULL;
|
||||||
chansess->agentdir = NULL;
|
chansess->agentdir = NULL;
|
||||||
@ -300,7 +300,7 @@ static void closechansess(struct Channel *channel) {
|
|||||||
x11cleanup(chansess);
|
x11cleanup(chansess);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_AGENTFWD
|
#ifdef ENABLE_SVR_AGENTFWD
|
||||||
svr_agentcleanup(chansess);
|
svr_agentcleanup(chansess);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ static void chansessionrequest(struct Channel *channel) {
|
|||||||
} else if (strcmp(type, "x11-req") == 0) {
|
} else if (strcmp(type, "x11-req") == 0) {
|
||||||
ret = x11req(chansess);
|
ret = x11req(chansess);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_AGENTFWD
|
#ifdef ENABLE_SVR_AGENTFWD
|
||||||
} else if (strcmp(type, "auth-agent-req@openssh.com") == 0) {
|
} else if (strcmp(type, "auth-agent-req@openssh.com") == 0) {
|
||||||
ret = svr_agentreq(chansess);
|
ret = svr_agentreq(chansess);
|
||||||
#endif
|
#endif
|
||||||
@ -945,7 +945,7 @@ static void execchild(void *user_data) {
|
|||||||
/* set up X11 forwarding if enabled */
|
/* set up X11 forwarding if enabled */
|
||||||
x11setauth(chansess);
|
x11setauth(chansess);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_AGENTFWD
|
#ifdef ENABLE_SVR_AGENTFWD
|
||||||
/* set up agent env variable */
|
/* set up agent env variable */
|
||||||
svr_agentset(chansess);
|
svr_agentset(chansess);
|
||||||
#endif
|
#endif
|
||||||
|
@ -162,10 +162,6 @@
|
|||||||
#define USING_LISTENERS
|
#define USING_LISTENERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_SVR_AGENTFWD) || defined(ENABLE_CLI_LOCALTCPFWD)
|
|
||||||
#define ENABLE_AGENTFWD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ENABLE_CLI_NETCAT) && defined(ENABLE_CLI_PROXYCMD)
|
#if defined(ENABLE_CLI_NETCAT) && defined(ENABLE_CLI_PROXYCMD)
|
||||||
#define ENABLE_CLI_MULTIHOP
|
#define ENABLE_CLI_MULTIHOP
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user