395 Commits

Author SHA1 Message Date
Manoj Ampalam
7f97b8188a Disable CNG for MingW builid 2015-11-08 23:49:18 -08:00
dkulwin
891836d333 Remove ssh-keygen from ssh-keysign project
ssh-keygen isn't needed by ssh-keysign and ssh-keygen.c and
ssh-keysign.c both have main.
2015-11-06 18:24:53 -06:00
dkulwin
c051e06f50 Add utility to automatically copy the config.h.vs file to config.h
Add a utility upon which every other project is dependent, to copy the
config.h.vs file to the source root config.h.  Because the target may
have changed outside of visual studio, I have disabled the dependency
check so the file will be copied with every build..
2015-11-06 13:07:51 -06:00
dkulwin
3a660dc4c7 Tweak kerberos function specs to match prototypes 2015-11-06 12:03:51 -06:00
dkulwin
df8c2c2b02 Change include paths to use matching plaform/config
The include paths for openssl should match the platform/config of the
project.
2015-11-06 12:03:50 -06:00
quamrulmina
4d952924e1 sftp client and server code changed to build & work with MS Visual Studio
Use new compile flag WIN32_VS to add/change logic of sftp client and
sftp server codes so that MS Visual Studio 2015 compiler and runtime can
be used. opendir(), readdir(), closedir() directory APIs and basename()
API of Unix/Linux are implemented in Windows as they are not available
in Windows/VisualStudio C-runtime. win32_dirent.c and win32_dirent.h
files added as dirent.c and dirent.h are not available in Windows and we
do not want to affect mingW/gcc builds for Windows which have those
files available.
2015-11-06 03:02:51 -06:00
dkulwin
65fb8f4c38 Fix kerberos prototypes for Visual studio
Visual studio wants call convention specification within the parenthesis
when declaring function variables.
2015-11-05 15:39:18 -06:00
dkulwin
2367dca1e9 Disable invalid parameter handler use under mingw
Mingw doesn't support the invalid parameter handler function in the same
way as visual studio.  Shouldn't be needed under mingw anyway.
2015-11-05 15:01:12 -06:00
manojampalam
9fa44f0777 Merge pull request #22 from noshbar/L1
Fix potential memory leak in win32/console.c
2015-11-05 12:26:22 -08:00
dkulwin
44510dc67e Back out kerberos prototype changes
Looks like the changes work for visual studio, but broke mingw.
2015-11-05 14:03:33 -06:00
dkulwin
99a38147f7 Updated Readme
Updated with new paths
2015-11-05 13:16:02 -06:00
dkulwin
095ae850aa path updates for visual studio solution
Added specific paths for different configurations of OpenSSL instead of
assuming a tree with all four.
2015-11-05 13:03:03 -06:00
dkulwin
7bd7008792 Add Visual Studio 2015 solution and projects
Add the solution, projects and filter files for building Win32-OpenSSH
binaries under visual studio 2015.
2015-11-04 19:34:21 -06:00
dkulwin
3bbefb6078 Add #ifdefs around #defines
In order to avoid redefinition warnings, check before we define.
2015-11-04 19:34:19 -06:00
dkulwin
5fd03ec459 Add some missing headers and defines to support visual studio
Visual studio compatibility changes.
2015-11-04 19:34:18 -06:00
dkulwin
11561cd62a add an invalid parameter handler to catch _get_osfhandle failures under visual studio
The sfds code blindly uses _get_osfhandle on values that may be file
descriptors, sockets or io handles.  Under visual studio, _get_osfhandle
will call the invalid parameter handler for items that are not file
descriptors.  Adding the handler allows us to call this in the same way
that mingw does.  We will still get an assertion, but a prior change
sends those to stdiout instead of making the user click through a
dialog.
2015-11-04 19:34:17 -06:00
dkulwin
2454a18404 whitespace after \ causes visual studio to not parse as a line continuation
Make the file work better in visual studio
2015-11-04 19:34:16 -06:00
dkulwin
39706fca9c Add code to stop asserts from tossing up dialogs
Assert dialogs can be a problem when running as a service.  This change
instructs assert info to be sent to stdout instead of a dialog.
2015-11-04 19:34:15 -06:00
dkulwin
25e52cb498 Add prototypes for functions returning pointers and modify how some arrays are defined
Functions not declared before use, are define as returning an int.
Under 64-bit this can result in corrupted pointers being returned.

Also, Visual studio doesn't like it when you use variables to declare
array sizes, static values always work though.
2015-11-04 19:34:15 -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
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
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
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
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
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
arif-pragmasys
bafc1df7c5 CTR and CBC mode CNG ciphers replacing OpenSSL ciphers 2015-10-17 11:09:01 -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
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
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
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
quamrulmina
5b06ebbbb5 sftp-server.exe first code drop that works
sftp-server.exe code modified to work in Windows as NoMachine never
finished it to work. I/O handling to work as a subsystem and
openssh7.1p1 sshbuf_new() buffer system code had to be used. sshd_config
file need location of sftp subsystem to be specified.
2015-09-30 20:26:32 -05:00
arif-pragmasys
aa2a62ddde regress test related make file update for win32 2015-09-30 17:06:44 -05:00
quamrulmina
6d167ae0f6 fix sftp.exe client to work using password authentication
ssh.exe client invoked underneath was not able to send password prompt
and read password from user as stdin and stdout handles were redirected
to sockets by sftp.exe ; stderr which is not redirected is used to show
prompt to users and data is read from console
2015-09-27 23:54:10 -05:00
arif-pragmasys
0d3a933c2a custom ssh and sshd config for win32 2015-09-23 14:51:40 -05:00
arif-pragmasys
f4b56e2280 nomachine + additional changes applied to openssh 7.1p1 source base 2015-09-21 16:03:51 -05:00
Arif Saikat
fb17410f60 Original Nomachine 5.9p1 source code
Original Nomachine 5.9p1 source code
2015-09-09 14:08:05 -05:00