mirror of
https://github.com/clearml/dropbear
synced 2025-05-31 02:18:13 +00:00
commit
4bba3268d5
@ -106,7 +106,7 @@ static void printhelp() {
|
|||||||
|
|
||||||
void cli_getopts(int argc, char ** argv) {
|
void cli_getopts(int argc, char ** argv) {
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
char ** next = 0;
|
char ** next = NULL;
|
||||||
enum {
|
enum {
|
||||||
OPT_EXTENDED_OPTIONS,
|
OPT_EXTENDED_OPTIONS,
|
||||||
#if DROPBEAR_CLI_PUBKEY_AUTH
|
#if DROPBEAR_CLI_PUBKEY_AUTH
|
||||||
|
@ -81,7 +81,7 @@ static const packettype cli_packettypes[] = {
|
|||||||
{SSH_MSG_REQUEST_SUCCESS, ignore_recv_response},
|
{SSH_MSG_REQUEST_SUCCESS, ignore_recv_response},
|
||||||
{SSH_MSG_REQUEST_FAILURE, ignore_recv_response},
|
{SSH_MSG_REQUEST_FAILURE, ignore_recv_response},
|
||||||
#endif
|
#endif
|
||||||
{0, 0} /* End */
|
{0, NULL} /* End */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ChanType *cli_chantypes[] = {
|
static const struct ChanType *cli_chantypes[] = {
|
||||||
|
@ -774,7 +774,7 @@ static void finish_kexhashbuf(void) {
|
|||||||
hash_desc->done(&hs, buf_getwriteptr(ses.hash, hash_desc->hashsize));
|
hash_desc->done(&hs, buf_getwriteptr(ses.hash, hash_desc->hashsize));
|
||||||
buf_setlen(ses.hash, hash_desc->hashsize);
|
buf_setlen(ses.hash, hash_desc->hashsize);
|
||||||
|
|
||||||
#if (DEBUG_KEXHASH) && (DEBUG_TRACE)
|
#if defined(DEBUG_KEXHASH) && DEBUG_TRACE
|
||||||
if (!debug_trace) {
|
if (!debug_trace) {
|
||||||
printhex("kexhashbuf", ses.kexhashbuf->data, ses.kexhashbuf->len);
|
printhex("kexhashbuf", ses.kexhashbuf->data, ses.kexhashbuf->len);
|
||||||
printhex("kexhash", ses.hash->data, ses.hash->len);
|
printhex("kexhash", ses.hash->data, ses.hash->len);
|
||||||
|
@ -59,7 +59,7 @@ process_file(hash_state *hs, const char *filename,
|
|||||||
unsigned int readcount;
|
unsigned int readcount;
|
||||||
int ret = DROPBEAR_FAILURE;
|
int ret = DROPBEAR_FAILURE;
|
||||||
|
|
||||||
#if DROPBEAR_PRNGD_SOCKET
|
#ifdef DROPBEAR_PRNGD_SOCKET
|
||||||
if (prngd)
|
if (prngd)
|
||||||
{
|
{
|
||||||
readfd = connect_unix(filename);
|
readfd = connect_unix(filename);
|
||||||
@ -107,7 +107,7 @@ process_file(hash_state *hs, const char *filename,
|
|||||||
wantread = MIN(sizeof(readbuf), len-readcount);
|
wantread = MIN(sizeof(readbuf), len-readcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DROPBEAR_PRNGD_SOCKET
|
#ifdef DROPBEAR_PRNGD_SOCKET
|
||||||
if (prngd)
|
if (prngd)
|
||||||
{
|
{
|
||||||
char egdcmd[2];
|
char egdcmd[2];
|
||||||
@ -185,7 +185,7 @@ void seedrandom() {
|
|||||||
/* existing state */
|
/* existing state */
|
||||||
sha1_process(&hs, (void*)hashpool, sizeof(hashpool));
|
sha1_process(&hs, (void*)hashpool, sizeof(hashpool));
|
||||||
|
|
||||||
#if DROPBEAR_PRNGD_SOCKET
|
#ifdef DROPBEAR_PRNGD_SOCKET
|
||||||
if (process_file(&hs, DROPBEAR_PRNGD_SOCKET, INIT_SEED_SIZE, 1)
|
if (process_file(&hs, DROPBEAR_PRNGD_SOCKET, INIT_SEED_SIZE, 1)
|
||||||
!= DROPBEAR_SUCCESS) {
|
!= DROPBEAR_SUCCESS) {
|
||||||
dropbear_exit("Failure reading random device %s",
|
dropbear_exit("Failure reading random device %s",
|
||||||
|
@ -134,7 +134,7 @@ int main(int argc, char ** argv) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
char ** next = 0;
|
char ** next = NULL;
|
||||||
char * filename = NULL;
|
char * filename = NULL;
|
||||||
enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE;
|
enum signkey_type keytype = DROPBEAR_SIGNKEY_NONE;
|
||||||
char * typetext = NULL;
|
char * typetext = NULL;
|
||||||
|
2
rsa.c
2
rsa.c
@ -346,7 +346,7 @@ void buf_put_rsa_sign(buffer* buf, dropbear_rsa_key *key, buffer *data_buf) {
|
|||||||
buf_incrwritepos(buf, ssize);
|
buf_incrwritepos(buf, ssize);
|
||||||
mp_clear(&rsa_s);
|
mp_clear(&rsa_s);
|
||||||
|
|
||||||
#if defined(DEBUG_RSA) && defined(DEBUG_TRACE)
|
#if defined(DEBUG_RSA) && DEBUG_TRACE
|
||||||
if (!debug_trace) {
|
if (!debug_trace) {
|
||||||
printhex("RSA sig", buf->data, buf->len);
|
printhex("RSA sig", buf->data, buf->len);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ static void printhelp(const char * progname) {
|
|||||||
void svr_getopts(int argc, char ** argv) {
|
void svr_getopts(int argc, char ** argv) {
|
||||||
|
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
char ** next = 0;
|
char ** next = NULL;
|
||||||
int nextisport = 0;
|
int nextisport = 0;
|
||||||
char* recv_window_arg = NULL;
|
char* recv_window_arg = NULL;
|
||||||
char* keepalive_arg = NULL;
|
char* keepalive_arg = NULL;
|
||||||
@ -289,7 +289,7 @@ void svr_getopts(int argc, char ** argv) {
|
|||||||
if (*next == NULL) {
|
if (*next == NULL) {
|
||||||
dropbear_exit("Invalid null argument");
|
dropbear_exit("Invalid null argument");
|
||||||
}
|
}
|
||||||
next = 0x00;
|
next = NULL;
|
||||||
|
|
||||||
if (keyfile) {
|
if (keyfile) {
|
||||||
addhostkey(keyfile);
|
addhostkey(keyfile);
|
||||||
|
@ -66,7 +66,7 @@ static const packettype svr_packettypes[] = {
|
|||||||
{SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation},
|
{SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation},
|
||||||
{SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure},
|
{SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure},
|
||||||
#endif
|
#endif
|
||||||
{0, 0} /* End */
|
{0, NULL} /* End */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ChanType *svr_chantypes[] = {
|
static const struct ChanType *svr_chantypes[] = {
|
||||||
|
@ -55,19 +55,19 @@ int tcp_prio_inithandler(struct Channel* channel)
|
|||||||
static void tcp_acceptor(struct Listener *listener, int sock) {
|
static void tcp_acceptor(struct Listener *listener, int sock) {
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
struct sockaddr_storage addr;
|
struct sockaddr_storage sa;
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
char ipstring[NI_MAXHOST], portstring[NI_MAXSERV];
|
char ipstring[NI_MAXHOST], portstring[NI_MAXSERV];
|
||||||
struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata);
|
struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata);
|
||||||
|
|
||||||
len = sizeof(addr);
|
len = sizeof(sa);
|
||||||
|
|
||||||
fd = accept(sock, (struct sockaddr*)&addr, &len);
|
fd = accept(sock, (struct sockaddr*)&sa, &len);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring),
|
if (getnameinfo((struct sockaddr*)&sa, len, ipstring, sizeof(ipstring),
|
||||||
portstring, sizeof(portstring),
|
portstring, sizeof(portstring),
|
||||||
NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
|
NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
|
||||||
m_close(fd);
|
m_close(fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user