533 Commits

Author SHA1 Message Date
dkulwin
319d1bb581 Add cast for GetProcAddress return
GetProcAddress returns a FARPROC, *, but compiler likes it better if you
give a proper cast to the function value.
2015-11-04 19:34:13 -06:00
dkulwin
27739d90ed #if out setting of compress hooks if not using ZLIB
We shouldn't even try to call ssh_packet_set_compress_hooks if zlib
isn't enabled.  This change conditionally compiles it out.
2015-11-04 19:34:13 -06:00
dkulwin
ddace27b97 VC2015 doesn't like it when you take a negative of on unsigned value
Negative of an unsigned value should just be the two's complement.  Add
code to change code with negative unsigned values to two's compliment
values if compiling under visual studio.
2015-11-04 19:34:12 -06:00
quamrulmina
bf2766ba2d Fix sshd server to not send back space erase when no character in the line
sshd server keeps count of characters typed on a line and will not send
backspace erase to the client if no character is there to erase on the
line even if the users is typing backspaces. This avoids erase of shell
prompt characters for visual user friendliness.
2015-11-04 17:10:40 -06:00
arif-pragmasys
9ec4bf235c Linux build compatible
Same source builds both in Linux and windows
2015-11-04 16:15:04 -06:00
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
dkulwin
b8d82456a7 Merge remote-tracking branch 'refs/remotes/origin/L1' 2015-10-28 15:58:08 -05:00
dkulwin
ef4ffdad49 Merge remote-tracking branch 'refs/remotes/origin/L1' 2015-10-28 15:54:35 -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
Dirk de la Hunt
5d455454de Fix potential memory leak in console.c
CAUTION: untested as my openssl installation has gone insane.

If the incoming "hScreen" parameter is NULL, a new PSCREEN_RECORD is
allocated to use in its place.
However, if the allocation of the "pScreenBuf" member variable fails,
the function returns, potentially leaking the newly allocated
PSCREEN_RECORD.

This fix first checks to see if the functions owns the "pScreenRec", and
if so, frees it before returning.
2015-10-22 20:04:14 +02: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
Manoj Ampalam
72e1c0ac81 Zipped Binary payload from Master 10-13-2015 10_13_2015 2015-10-13 23:27:13 -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