Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nxssh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Konstantin Artyushkin
nxssh
Commits
74109f5c
Commit
74109f5c
authored
8 years ago
by
Stas Korobeynikov
Committed by
Pavel Vainerman
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add/fix log
parent
923a89e2
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
6 deletions
+70
-6
channels.c
channels.c
+2
-0
clientloop.c
clientloop.c
+17
-1
misc.c
misc.c
+2
-0
packet.c
packet.c
+28
-1
ssh.c
ssh.c
+4
-0
sshconnect.c
sshconnect.c
+10
-1
sshconnect2.c
sshconnect2.c
+5
-1
ttymodes.c
ttymodes.c
+2
-2
No files found.
channels.c
View file @
74109f5c
...
...
@@ -3676,11 +3676,13 @@ channel_request_remote_forwarding(struct Forward *fwd)
/* Wait for response from the remote side. */
type
=
packet_read
();
logit
(
"%d"
,
type
);
switch
(
type
)
{
case
SSH_SMSG_SUCCESS
:
success
=
1
;
break
;
case
SSH_SMSG_FAILURE
:
logit
(
"Warning: Server denied remote port forwarding."
);
break
;
default:
/* Unknown packet */
...
...
This diff is collapsed.
Click to expand it.
clientloop.c
View file @
74109f5c
...
...
@@ -424,6 +424,9 @@ client_x11_get_proto(const char *display, const char *xauth_path,
got_data
=
1
;
if
(
f
)
pclose
(
f
);
}
else
{
debug
(
"Warning: untrusted X11 forwarding setup failed: "
"xauth key data not generated"
);
}
}
...
...
@@ -451,7 +454,7 @@ client_x11_get_proto(const char *display, const char *xauth_path,
u_int8_t
rnd
[
16
];
u_int
i
;
logit
(
"Warning: No xauth data; "
debug
(
"Warning: No xauth data; "
"using fake authentication data for X11 forwarding."
);
strlcpy
(
proto
,
SSH_X11_PROTO
,
sizeof
proto
);
arc4random_buf
(
rnd
,
sizeof
(
rnd
));
...
...
@@ -1146,6 +1149,10 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr,
if
(
len
<=
0
)
return
(
0
);
#ifdef DEBUG
debug
(
"NX> 280 Processing the escape chars in context: 1"
);
#endif
for
(
i
=
0
;
i
<
(
u_int
)
len
;
i
++
)
{
/* Get one character at a time. */
ch
=
buf
[
i
];
...
...
@@ -1419,6 +1426,11 @@ client_process_input(fd_set *readset)
* character and have to process the characters one
* by one.
*/
#ifdef DEBUG
debug
(
"NX> 280 Processing the escape chars in context: 2"
);
#endif
if
(
process_escapes
(
NULL
,
&
stdin_buffer
,
&
stdout_buffer
,
&
stderr_buffer
,
buf
,
len
)
==
-
1
)
return
;
...
...
@@ -1548,6 +1560,10 @@ client_simple_escape_filter(Channel *c, char *buf, int len)
if
(
c
->
extended_usage
!=
CHAN_EXTENDED_WRITE
)
return
0
;
#ifdef DEBUG
debug
(
"NX> 280 Processing the escape chars in context: 3"
);
#endif
return
process_escapes
(
c
,
&
c
->
input
,
&
c
->
output
,
&
c
->
extended
,
buf
,
len
);
}
...
...
This diff is collapsed.
Click to expand it.
misc.c
View file @
74109f5c
...
...
@@ -148,11 +148,13 @@ set_nodelay(int fd)
return
;
}
if
(
opt
==
1
)
{
debug
(
"NX> 286 SSH reports TCP_NODELAY already set on descriptor: %d"
,
fd
);
debug2
(
"fd %d is TCP_NODELAY"
,
fd
);
return
;
}
opt
=
1
;
debug2
(
"fd %d setting TCP_NODELAY"
,
fd
);
debug
(
"NX> 286 SSH is setting TCP_NODELAY on descriptor: %d"
,
fd
);
if
(
setsockopt
(
fd
,
IPPROTO_TCP
,
TCP_NODELAY
,
&
opt
,
sizeof
opt
)
==
-
1
)
error
(
"setsockopt TCP_NODELAY: %.100s"
,
strerror
(
errno
));
}
...
...
This diff is collapsed.
Click to expand it.
packet.c
View file @
74109f5c
...
...
@@ -1452,6 +1452,11 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
timeoutp
=
&
timeout
;
}
/* Wait for some data to arrive. */
#ifdef TEST
debug
(
"NX> 280 Calling the NX select in context: 7"
);
#endif
for
(;;)
{
if
(
state
->
packet_timeout_ms
!=
-
1
)
{
ms_to_timeval
(
&
timeout
,
ms_remain
);
...
...
@@ -1479,7 +1484,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
#ifdef TEST
logit
(
"NX> 280 Reading: %u bytes from fd: %d in context: 7"
,
sizeof
(
buf
),
connection_in
);
sizeof
(
buf
),
state
->
connection_in
);
#endif
len
=
read
(
state
->
connection_in
,
buf
,
sizeof
(
buf
));
...
...
@@ -2275,6 +2280,11 @@ ssh_packet_write_wait(struct ssh *ssh)
ms_remain
=
state
->
packet_timeout_ms
;
timeoutp
=
&
timeout
;
}
#ifdef TEST
debug
(
"NX> 280 Calling the NX select in context: 9"
);
#endif
for
(;;)
{
if
(
state
->
packet_timeout_ms
!=
-
1
)
{
ms_to_timeval
(
&
timeout
,
ms_remain
);
...
...
@@ -2329,6 +2339,17 @@ ssh_packet_not_very_much_data_to_write(struct ssh *ssh)
void
ssh_packet_set_tos
(
struct
ssh
*
ssh
,
int
tos
)
{
#if defined(IP_TOS) && !defined(IP_TOS_IS_BROKEN)
if
(
ssh_packet_connection_is_on_socket
(
ssh
))
{
debug
(
"NX> 286 Setting %s on fd: %d"
,
(
tos
==
IPTOS_LOWDELAY
?
"IPTOS_LOWDELAY"
:
"IPTOS_THROUGHPUT"
),
ssh
->
state
->
connection_in
);
}
#else
debug
(
"NX> 286 WARNING! Not setting TOS on fd: %d with IP_TOS: %d IP_TOS_IS_BROKEN: %d"
,
ssh
->
state
->
connection_in
,
IP_TOS
,
IP_TOS_IS_BROKEN
);
#endif
#ifndef IP_TOS_IS_BROKEN
if
(
!
ssh_packet_connection_is_on_socket
(
ssh
))
return
;
...
...
@@ -2360,6 +2381,12 @@ ssh_packet_set_tos(struct ssh *ssh, int tos)
void
ssh_packet_set_interactive
(
struct
ssh
*
ssh
,
int
interactive
,
int
qos_interactive
,
int
qos_bulk
)
{
debug
(
"NX> 286 Called packet_set_interactive() for fd: %d interactive is: %d"
,
ssh
->
state
->
connection_in
,
interactive
);
debug
(
"NX> 286 Forcing interactive to: %d for fd: %d"
,
interactive
,
ssh
->
state
->
connection_in
);
struct
session_state
*
state
=
ssh
->
state
;
if
(
state
->
set_interactive_called
)
...
...
This diff is collapsed.
Click to expand it.
ssh.c
View file @
74109f5c
...
...
@@ -534,6 +534,10 @@ main(int ac, char **av)
struct
ssh_digest_ctx
*
md
;
u_char
conn_hash
[
SSH_DIGEST_MAX_LENGTH
];
if
(
NxModeEnabled
)
{
logit
(
"NX> 203 NXSSH running with pid: %d"
,
getpid
());
}
ssh_malloc_init
();
/* must be called before any mallocs */
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
sanitise_stdfd
();
...
...
This diff is collapsed.
Click to expand it.
sshconnect.c
View file @
74109f5c
...
...
@@ -495,6 +495,11 @@ ssh_connect_direct(const char *host, struct addrinfo *aitop,
debug
(
"Connection established."
);
#ifdef TEST
logit
(
"NX> 280 SSH connection established with fd: %d"
,
sock
);
#endif
/* Set SO_KEEPALIVE if requested. */
if
(
want_keepalive
&&
setsockopt
(
sock
,
SOL_SOCKET
,
SO_KEEPALIVE
,
(
void
*
)
&
on
,
...
...
@@ -1177,7 +1182,7 @@ check_host_key(char *hostname, struct sockaddr *hostaddr, u_short port,
if
(
options
.
check_host_ip
&&
host_status
!=
HOST_CHANGED
&&
ip_status
==
HOST_CHANGED
)
{
snprintf
(
msg
,
sizeof
(
msg
),
"Warning: the %s host key for '%.200s' "
"
NX> 212
Warning: the %s host key for '%.200s' "
"differs from the key for the IP address '%.128s'"
"
\n
Offending key for IP in %s:%lu"
,
type
,
host
,
ip
,
ip_found
->
file
,
ip_found
->
line
);
...
...
@@ -1385,10 +1390,14 @@ ssh_login(Sensitive *sensitive, const char *orighost,
debug
(
"Authenticating to %s:%d as '%s'"
,
host
,
port
,
server_user
);
if
(
compat20
)
{
ssh_kex2
(
host
,
hostaddr
,
port
);
if
(
NxModeEnabled
)
logit
(
"NX> 202 Authenticating user: %.200s"
,
server_user
);
ssh_userauth2
(
local_user
,
server_user
,
host
,
sensitive
);
}
else
{
#ifdef WITH_SSH1
ssh_kex
(
host
,
hostaddr
);
if
(
NxModeEnabled
)
logit
(
"NX> 202 Authenticating user: %.200s"
,
server_user
);
ssh_userauth1
(
local_user
,
server_user
,
host
,
sensitive
);
#else
fatal
(
"ssh1 is not supported"
);
...
...
This diff is collapsed.
Click to expand it.
sshconnect2.c
View file @
74109f5c
...
...
@@ -1239,7 +1239,7 @@ load_identity_file(Identity *id)
return
NULL
;
}
snprintf
(
prompt
,
sizeof
prompt
,
"Enter passphrase for key '%.100s': "
,
id
->
filename
);
"
NX> 210
Enter passphrase for key '%.100s': "
,
id
->
filename
);
for
(
i
=
0
;
i
<=
options
.
number_of_password_prompts
;
i
++
)
{
if
(
i
==
0
)
passphrase
=
""
;
...
...
@@ -1896,7 +1896,11 @@ authmethod_lookup(const char *name)
for
(
method
=
authmethods
;
method
->
name
!=
NULL
;
method
++
)
if
(
strcmp
(
name
,
method
->
name
)
==
0
)
return
method
;
if
(
NxAuthOnlyModeEnabled
)
{
debug2
(
"Skipping authentication method name: %s"
,
name
?
name
:
"NULL"
);
}
else
{
debug2
(
"Unrecognized authentication method name: %s"
,
name
?
name
:
"NULL"
);
}
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
ttymodes.c
View file @
74109f5c
...
...
@@ -302,7 +302,7 @@ tty_make_modes(int fd, struct termios *tiop)
goto
end
;
}
if
(
tcgetattr
(
fd
,
&
tio
)
==
-
1
)
{
logit
(
"tcgetattr: %.100s"
,
strerror
(
errno
));
//
logit("tcgetattr: %.100s", strerror(errno));
goto
end
;
}
}
else
...
...
@@ -371,7 +371,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
* modes, they will initially have reasonable values.
*/
if
(
tcgetattr
(
fd
,
&
tio
)
==
-
1
)
{
logit
(
"tcgetattr: %.100s"
,
strerror
(
errno
));
//
logit("tcgetattr: %.100s", strerror(errno));
failure
=
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment