Commit Graph

74 Commits

Author SHA1 Message Date
quamrulmina 7683cc1f65 ssh -V does not need to show the time of build, date is sufficient
Take out ___TIME___  and show ___DATE___ in win32 port as both were
win32 enhancements.
2015-11-02 00:43:09 -06:00
quamrulmina 484bab654b Identify ssh client version with more info and sshd server shows it by an env var
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.
2015-11-01 01:25:19 -06:00
quamrulmina 6c4fc9c4c5 version.h file uses WIN32_FIXME and ssh.exe client shows build & date
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.
2015-10-31 17:47:41 -05:00
quamrulmina e918f7c731 IPC env var and handle used by sshd is made unavailable to shell/subsystem
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.
2015-10-31 17:07:07 -05:00
dkulwin 3ab9c8f055 fix bug in cng cipher keyobject processing
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.
2015-10-31 12:06:18 -05:00
quamrulmina fad3c4ffc6 Fixed ssh client problem of showing error outputs correctly
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.
2015-10-30 19:36:26 -05:00
dkulwin bc6871e862 Add CNG manual memory management code to support Vista
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.
2015-10-29 15:46:37 -05:00
dkulwin 728c299d67 Fix CNG hash GetProperty bug
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.
2015-10-29 15:07:09 -05:00
dkulwin c4fb7d76ee Manually manage bcrypt hash memory in order to support Vista
The CNG routines added improved memory management in windows 7.  In
order to support Vista, we need to manually manage the scratch memory
used by cng.
2015-10-29 13:08:22 -05:00
quamrulmina 889e58c056 Fix ssh client not executing shell cmd given as argument
"ssh user@host whoami" now works and will show the whoami command
output. sshd server was fine but ssh client was not working.
2015-10-28 18:11:52 -05:00
quamrulmina 3c6c8c3ca5 Fix ssh/sshd failing in Windows 7 due to a flag use in cng_digest
Avoid using BCRYPT_HASH_REUSABLE_FLAG in cng_digest.c file which was
introduced in Windows 8 and not supported in previous OS like Windows 7.
2015-10-28 15:37:02 -05:00
quamrulmina e743b54a61 Fix ssh client to generate LF or CRLF correctly
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.
2015-10-28 00:31:24 -05:00
quamrulmina d4c8ef9ac5 Improved SSH client interactive mode and fixed control-c to work
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.
2015-10-27 19:05:38 -05:00
quamrulmina 1c258ec0ae Fix control-c working in sshd server
control-c is handled correctly by sshd server and passed to shell for it
to process which usually means terminating the current program or
programs.
2015-10-26 15:19:27 -05:00
quamrulmina 1178689011 sshd pty console screen size set to what ssh client requests
Initial remote console screen size set correctly in sshd interactive
session to the value we received from the ssh client in the pty-req
request.
2015-10-25 23:54:56 -05:00
quamrulmina b56534c4a6 Microsoft Copyright message added to all new files
New files for openssh win32 port now contain MS Copyright texts.
2015-10-25 17:33:46 -05:00
quamrulmina a3d0255b69 Fix Console Insertion issue of multiple sshd interactive sessions not working
We create console for each sshd session from CONIN$ and CONOUT$ before
starting shell cmd.exe
2015-10-25 01:53:38 -05:00
quamrulmina 339912c24b Use a Console as input to drive a shell in sshd.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.
2015-10-23 19:11:29 -05:00
arif-pragmasys ce1d1340d9 cng digest code changes to replace openssl digest 2015-10-22 16:03:39 -05:00
quamrulmina 89452c8a2f There shouldn't be any "*" when entering a password or passphrase
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
2015-10-20 19:23:18 -05:00
quamrulmina de4ae13f76 ssh.exe client sends current window size and TERM value when pty-req is made
This was not coded before for Win32 port. Remote sshd server is now
aware of our client's screen size and VT/ANSI TERM emulation.
2015-10-20 18:25:06 -05:00
arif-pragmasys f1d8b2e72d add temp key files to ignore list 2015-10-20 14:28:23 -05:00
arif-pragmasys 9d68c58a02 remove key files as they are generated when needed 2015-10-20 14:26:29 -05:00
arif-pragmasys e2beaa0cc1 add key files to ignore list 2015-10-20 13:51:56 -05:00
arif-pragmasys 7e326eba4a remove key files, since they are supposed to be generated as needed 2015-10-20 13:51:07 -05:00
Manoj Ampalam c636c1ec17 Merged README.md 2015-10-20 10:09:00 -07:00
quamrulmina 2cfb138bb8 Add local shell access feature in sftp.exe client
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.
2015-10-19 17:56:08 -05:00
Steve Lee 98dc596200 Update README.md 2015-10-19 12:42:39 -07:00
arif-pragmasys ac42afd122 Path correction for lib bcrypt 2015-10-18 22:25:41 -05:00
arif-pragmasys bafc1df7c5 CTR and CBC mode CNG ciphers replacing OpenSSL ciphers 2015-10-17 11:09:01 -05:00
arif-pragmasys d59177d82e exclude temp files 2015-10-16 15:47:12 -05:00
arif-pragmasys 2138a4acaf make files are autogenerated 2015-10-16 15:30:42 -05:00
quamrulmina 7aac59e524 Add ANSI parsing engine and console draw support to ssh client
Makes the ssh.exe client more useable in interactive mode with ANSI
color and a console screen support.
2015-10-15 17:25:39 -05:00
Steve Lee a55816fc15 Update README
Added link to wiki
2015-10-14 13:45:46 -07:00
quamrulmina 44a6f54fc4 sshd updates USERDOMAIN env variable correctly
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
2015-10-12 23:58:57 -05:00
quamrulmina ded4138b58 sshd server puts remote user@target in the console prompt
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.
2015-10-12 22:53:21 -05:00
quamrulmina 9fa909e3df Remote directory on sftp logon is set to user's home directory #7
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.
2015-10-12 19:24:12 -05:00
arif-pragmasys 7f3709e11f config file to made dsa key auth work 2015-10-12 17:24:46 -05:00
quamrulmina 55f2ec6825 Add pty mode support code
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.
2015-10-12 13:49:15 -05:00
quamrulmina b72c36c802 Fix USERNAME env variable not set correctly
USERNAME environment variable is set correctly with the remote logged on
username.
2015-10-11 02:38:44 -05:00
quamrulmina 5c3dc0554f Fixed Wrong user profile folder created on first logon through ssh problem
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.
2015-10-10 19:26:39 -05:00
quamrulmina 47df66126a configure file needed unix style LF format
configure file had Windows DOS style CRLF, but needs to have LF format
2015-10-09 12:11:58 -05:00
quamrulmina f384477c6d ssh client creates .ssh directory and points to well defined files relative to user home directory
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.
2015-10-08 21:52:24 -05:00
arif-pragmasys 673d697444 remove zlib and libssp dependency 2015-10-07 17:03:43 -05:00
quamrulmina 5655e833c9 Ignore test generated data files
ignore test run output files
2015-10-07 14:19:22 -05:00
quamrulmina 545dda2c8b Add ANSI processing in ssh client pty code to detect LF to CRLF mode
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.
2015-10-07 14:06:44 -05:00
arif-pragmasys 522af1564b fix file open() and fstat() issues in tests 2015-10-05 21:22:05 -05:00
quamrulmina ac89e98293 add pty support to ssh client
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).
2015-10-05 15:46:37 -05:00
quamrulmina 989b8a9f01 improved sshd child monitor code to avoid annoying "broken pipe" msg from Linux clients
take child detection handle out from select mux after a child process is
detected to have exited so that other code exit handlings can run its
course
2015-10-02 18:35:08 -05:00
quamrulmina 1915208a54 Fixed sshd process not ending when sftp-server and the shell ended
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.
2015-10-02 14:18:49 -05:00