You need to sign in or sign up before continuing.
Commit 15ce77de authored by Stas Korobeynikov's avatar Stas Korobeynikov Committed by Pavel Vainerman

add declarations are needed to compile without linking

parent 6ea00158
......@@ -47,6 +47,11 @@
#include "ssh.h"
#include "uidswap.h"
extern int NxAuthOnlyModeEnabled;
extern int NXStdinPassEnabled;
extern int NXServerMode;
extern int NxAdminModeEnabled;
static char *
ssh_askpass(char *askpass, const char *msg)
{
......
......@@ -59,6 +59,7 @@
#include "krl.h"
#include "digest.h"
#include "utf8.h"
#include "servconf.h"
#ifdef WITH_OPENSSL
# define DEFAULT_KEY_TYPE_NAME "rsa"
......@@ -182,6 +183,18 @@ extern char *__progname;
char hostname[NI_MAXHOST];
/* NX MODE */
/*
* This declarations are needed to compile ssh-keygen without linking to nxcomp
*/
int NxModeEnabled = 0;
int NxAuthOnlyModeEnabled = 0;
int NXStdinPassEnabled = 0;
ServerOptions options;
#ifdef WITH_OPENSSL
/* moduli.c */
int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
......@@ -845,7 +858,7 @@ fingerprint_one_key(const struct sshkey *public, const char *comment)
ra = sshkey_fingerprint(public, fingerprint_hash, SSH_FP_RANDOMART);
if (fp == NULL || ra == NULL)
fatal("%s: sshkey_fingerprint failed", __func__);
mprintf("%u %s %s (%s)\n", sshkey_size(public), fp,
printf("%u %s %s (%s)\n", sshkey_size(public), fp,
comment ? comment : "no comment", sshkey_type(public));
if (log_level >= SYSLOG_LEVEL_VERBOSE)
printf("%s\n", ra);
......@@ -1169,7 +1182,7 @@ known_hosts_find_delete(struct hostkey_foreach_line *l, void *_ctx)
known_hosts_hash(l, ctx);
else if (print_fingerprint) {
fp = sshkey_fingerprint(l->key, fptype, rep);
mprintf("%s %s %s %s\n", ctx->host,
printf("%s %s %s %s\n", ctx->host,
sshkey_type(l->key), fp, l->comment);
free(fp);
} else
......@@ -1320,7 +1333,7 @@ do_change_passphrase(struct passwd *pw)
fatal("Failed to load key %s: %s", identity_file, ssh_err(r));
}
if (comment)
mprintf("Key has comment '%s'\n", comment);
printf("Key has comment '%s'\n", comment);
/* Ask the new passphrase (twice). */
if (identity_new_passphrase) {
......@@ -2462,6 +2475,18 @@ main(int argc, char **argv)
break;
#ifdef WITH_OPENSSL
/* Moduli generation/screening */
case 'W':
generator_wanted = (u_int32_t)strtonum(optarg, 1,
UINT_MAX, &errstr);
if (errstr)
fatal("Desired generator has bad value: %s (%s)",
optarg, errstr);
break;
case 'M':
memory = (u_int32_t)strtonum(optarg, 1, UINT_MAX, &errstr);
if (errstr)
fatal("Memory limit is %s: %s", errstr, optarg);
break;
case 'G':
do_gen_candidates = 1;
if (strlcpy(out_file, optarg, sizeof(out_file)) >=
......@@ -2474,35 +2499,22 @@ main(int argc, char **argv)
case 'j':
start_lineno = strtoul(optarg, NULL, 10);
break;
case 'T':
do_screen_candidates = 1;
if (strlcpy(out_file, optarg, sizeof(out_file)) >=
sizeof(out_file))
fatal("Output filename too long");
break;
case 'K':
if (strlen(optarg) >= PATH_MAX)
fatal("Checkpoint filename too long");
checkpoint = xstrdup(optarg);
break;
case 'M':
memory = (u_int32_t)strtonum(optarg, 1, UINT_MAX,
&errstr);
if (errstr)
fatal("Memory limit is %s: %s", errstr, optarg);
break;
case 'S':
/* XXX - also compare length against bits */
if (BN_hex2bn(&start, optarg) == 0)
fatal("Invalid start point.");
break;
case 'T':
do_screen_candidates = 1;
if (strlcpy(out_file, optarg, sizeof(out_file)) >=
sizeof(out_file))
fatal("Output filename too long");
break;
case 'W':
generator_wanted = (u_int32_t)strtonum(optarg, 1,
UINT_MAX, &errstr);
if (errstr != NULL)
fatal("Desired generator invalid: %s (%s)",
optarg, errstr);
break;
#endif /* WITH_OPENSSL */
case '?':
default:
......
......@@ -103,3 +103,5 @@
/* Listen backlog for sshd, ssh-agent and forwarding sockets */
#define SSH_LISTEN_BACKLOG 128
extern int NxModeEnabled;
......@@ -78,6 +78,10 @@ static int matching_host_key_dns = 0;
static pid_t proxy_command_pid = 0;
extern int NxAuthOnlyModeEnabled;
extern int NxAdminModeEnabled;
extern int webproxy_flag;
/* import */
extern Options options;
extern char *__progname;
......
......@@ -82,6 +82,11 @@ extern char *client_version_string;
extern char *server_version_string;
extern Options options;
extern int NxAuthOnlyModeEnabled;
extern int NXServerMode;
extern int NxAdminModeEnabled;
extern int NXStdinPassEnabled;
/*
* SSH2 key exchange
*/
......
......@@ -131,6 +131,30 @@
extern char *__progname;
/* NX MODE */
/*
* This declarations are needed to compile sshd without linking to nxcomp
*/
int NxModeEnabled = 0;
int nx_check_switch = 0;
int nx_switch_received = 0;
int nx_switch_forward = 0;
int nx_open_proxy_connection() {return 0;}
int nx_check_proxy_authentication(int proxy_fd) {return 0;}
int nx_switch_client_side_descriptors(Channel *channel, int proxy_fd) {return 0;}
int nx_switch_forward_descriptors(Channel *channel) {return 0;}
int nx_check_channel_input(Channel *channel, char *data, int *length, int limit) {return 0;}
int nx_switch_forward_port(Channel *channel) {return 0;}
int nx_proxy_select (int maxfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout)
{
return select(maxfds, readfds, writefds, exceptfds, timeout);
}
void nx_set_socket_options(int fd, int blocking) {}
/* Server configuration options. */
ServerOptions options;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment