MS Win32 port & build date added in text part of version id ssh client
send to the remote sshd. sshd also shows this string via environment
variable "SSH_CLIENT_ID" . All these are allowed and encouraged by the
SSH RFC and improves usability and assists users to know what ssh
versions and vendor build they are running.
version.h file retains non win32 original code as it should; feature
added for win32 for ssh.exe to show build and date like sshd.exe rather
than a fixed date we had inserted before in version.h file.
sshd.exe uses SSHD_REMSOC env var as private IPC for remote socket
handle passing. The env var is deleted and the handle is made not
inheritable by sshd so that shell and subsystem do not see it or have
access to the handle.
KeyObject for cipher symmetric key was being allocated improperly due to
an error in getting the key object size. Also added code to free
keyobject in the event of a key creation failure.
Problem was error data received were shown after output data. But order
should be kept to how it is received from the sshd server. Now we show
error and output data in the way we received from the sshd sever. Thus
typing "di" in place of "dir" in cmd shell will show the error message
correctly before the next shell prompt comes through.
Windows 7 improved the memory management in CNG. To support Vista we
need to manage memory for cryptographic objects ourselves. This change
adds a key object memory pointer to the cipher context and adds code to
allocate and free it along with the key handle.
ssh_digest_start was using a pointer to the algorithm handle instead of
the algorithm handle itself in the BCryptGetProperty call. It was also
querying for the hash length when it should have been querying for the
hash object length.
Typically LF is sent when Return key is hit. But for sshd servers that
sent us via ANSI escape sequence that CRLF is to be sent, ssh.exe client
will do so which is used commonly used by sshd servers in Windows - like
our own win32 port sshd.
Console API is now used for interactive tty mode. Thus ssh.exe client
can now pass each character to remote side as one types so that programs
like more works correctly. Control-c now will stop the remote program
instead of exiting the ssh.exe.
Fixes issues like cmd.exe shell not handling backspace, control-c.
Control-c is still a work in progress and will be fixed but backspace
processing works. This work when complete will make cmd.exe shell and
powershell work better for interactive users.
There shouldn't be any "*" when entering a password or passphrase for
better security. Linux/Unix openssh works the same way - without any
"*". Great suggestion by Mark Hahnel in comments of Issue #5
This was not implemented before in Win32. !takes to the windows shell
and !command runs the command in Windows shell. exit brings the user
back to sftp like in Linux/Unix shell.
USERDOMAIN environment variable was not being updated by sshd before s
shell or subsystem was started, hence it was left pointing to local
logged on user;'s domain. Now we set it correctly for the remote ssh
user's domain or local account
Usability improvement fix ( issue #6 ). sshd.exe puts remote user and
host info on the console prompt. user@target $P$G is set as cmd.exe
PROMPT via environment variable.
Fix the reported problem #7. Remote directory set to remote user's home
directory like its is done on openssh on all platforms. Users can then
cd to "Documents" directory. Actual fix was to expand "." to user's home
directory so that pwd showed it correctly rather than just showing a
dot.
Pty mode code added so that sshd server can do remote echo, backspace
processing. etc and ssh.exe client does not have to do local echo. We
can enrich it in future for more features and allowing programs like
powershell to run interactive. Pty mode is central for interactive use
and will be built using Windows console instead of termios that
Linux/Unix uses.
Fixed this #3 problem ticket. We determine domain hostname which created
the authenticated token from the token and then pass it to
LoadUserProfile() Windows API which now correctly creates the user's
home directory name and profile folder.
Will fix problems like new hosts to be added to known_hosts file which
was failing when .ssh directory did not exist. Also default user's
public keys like id_rsa pairs are picked up properly from the user's
homdir/.ssh base.
Whether LF should be changed to CR-LF is determined by what the remote
sshd server wants. Sequences like ESC[20h is sent by sshd servers in pty
ANSI mode. Unix servers usually want LF and Windows servers CR-LF. Added
simple ANSI data check now for pty use in interactive mode. Need to
expand to simple ANSI engine in future for processing other ANSI
terminal attributes.
pty and tty support was not enabled or working in the code. Without pty
support, ssh client was very non functional - e.g. openssh linux server
prompt would not come through. Now ssh client works much better in
interactive mode ( uses pty).
NoMachine did not finish coding child process ending detection logic.
Added the needed code so that child process handle is added to the
handles that WaitForMultipleObjects() waits for in nomachine select()
implementation in socket.c. Otherwise select() would be stuck in
read/write dectection even when the process of interest has exited.