Commit Graph

162 Commits

Author SHA1 Message Date
Manoj Ampalam 754f7b4885 Ported v8.1 changes 2019-11-01 12:20:04 -07:00
bagajjal 32976d0d7e fix onecore build issues (#402) 2019-11-01 11:11:24 -07:00
bagajjal 762b888b89 Added config option to target a specific version of LibreSSL (#405)
Version of LibreSSL to link to, now needs to be explicitly declared in paths.targets
2019-11-01 11:10:33 -07:00
bagajjal 0d93457a2e Added compression support vai Zlib (#404) 2019-11-01 10:57:34 -07:00
Manoj Ampalam d9773976a7
fix testbreak with SSH_ASKPASS change (#394)
Added askpass utility to support change around SSH_ASKPASS logic. Since prompt is now passed as a commandline parameter to SSH_ASKPASS, "cmd /c echo" based logic no longer works for automated passing of password.
2019-09-13 14:13:42 -07:00
Manoj Ampalam 9cc51aa7e4
Fixed issue around incorrect handling of Handle and CredHandle types in Kerb GSS/SSPI adapter code
Prior logic was using a common variable to encapsulate both these types and doing a runtime check based on GetTokenInformation call to determine the actual underlying type. These two types are not guaranteed to have different values and any conflict could result in a random crash that would be nearly impossible to debug.
2019-09-10 14:38:16 -07:00
Manoj Ampalam 1137942918
Refactored pester based E2E test setup (#384)
- Set up dedicated test endpoint instead of tweaking main service configuration.
- Got rid of redundant custom test configuration files.
- Cleaned up pester tests directory. Moved test filed to dedicated directory
- Revised TestDaemon start/stop routines to use "netstat" for host process identification. This gets rid of slight flakiness in previous approach.
2019-06-17 22:46:33 -07:00
Manoj Ampalam 7ed284f878
Ported v8.0 changes 2019-05-24 23:08:06 -07:00
Bryan Berns 44ba5483cd Enable PKCS11 Support (#331)
- Enable use of PKCS11 library files by adjusting central configuration file.
- Modified dlsym() to return a void pointer instead of an int which is consistent with POSIX. The previous return type caused an issue with 32-bit builds with PKCS11 enabled.
2019-05-21 13:36:24 -07:00
Manoj Ampalam cc708b2b7c
sshd_config - change default for GSSAPIAuthentication (#370)
As per https://man.openbsd.org/sshd_config, default for GSSAPIAuthentication is "no"
2019-01-10 10:29:12 -08:00
Manoj Ampalam d930619073
Override default location for authorized_keys for administrators (#369) 2019-01-08 22:23:58 -08:00
Bryan Berns 2f551d4535 Kerberos SSPI Support Via GSSAPI
Added an implementation of GSSAPI interface to support Kerberos SSPI within OpenSSH. This is only a partial definition of the full GSSAPI specification since OpenSSH only requires a subset of the overall GSSAPI functionality.
2019-01-08 20:29:58 -08:00
Yanbing a75116b6f8 Fix of 1211 and 1082 (#349)
PowerShell/Win32-OpenSSH#1211
PowerShell/Win32-OpenSSH#1082

Added support for posix_spawnp that executes the command directly instead of appending path. (SH_ASKPASS and proxy command use this). Refactored posix spawn commandline building logic to automatically account for Windows CRT escaping rules on all arguments.
2018-11-05 12:22:20 -08:00
Manoj Ampalam d74ae2e5dd Ported V7.9 changes 2018-10-25 12:22:09 -07:00
Manoj Ampalam 456c5fc72b Merge branch 'V_7_9' of https://github.com/openssh/openssh-portable 2018-10-25 11:55:02 -07:00
Manoj Ampalam 68719a25df Ported fork to 7.8 2018-10-05 15:11:07 -07:00
Manoj Ampalam af4e4113b2
Ported bash based E2E tests and integrated security fix for cve-2018-15473(#346)
- Updated code to dynamic load Lsa functions until RS5 SDK includes them
 - Add conpty support in openssh
- Fixed Wierd characters (?25l) are seen, when logged in from ssh client
- Backspace doesn't work in powershell window
- Changes to support ssh-shellhost as an alternative shell
- Added support to have ssh-shellhost work as a standby shell (ssh-shellhost -c "cmdline") simply executes cmdline via CreateProcess
- Added E2E test cases and fixed unittests broken from prior changes
- Added PTY launch interface that supports both conpty and ssh-shellhost pty.
- Implemented PTY control channel in ssh-shellhost that supports Window resize events.
- Fixed regression with starting a PTY session with an explicit command
- modified ssh-shellhost pty argument to ---pty to remove ambiguity in cases when both -p and -c are present in commandline. Ex. ssh-shellhost.exe -c "myprogram -p -c argument"
2018-10-04 14:16:02 -07:00
Yanbing fc6d825b4d
Revert the isolation changes on Admin and Operational Channels
Revert the isolation changes on Admin and Operational Channels. They are enable by default and setting them to custom isolation adds 2 more independent autologgers on the system.
2018-09-19 11:54:04 -07:00
Yanbing 9e983eadf6
check the full name of the root instead of directory info (#342) 2018-09-17 16:48:52 -07:00
Yanbing 06ba674c67
Fix of issues 1139 (#341)
Fix of PowerShell/Win32-OpenSSH#1139. Now user can build use solution file without manual steps
1. Added prebuildevent to copy libressl
2. When there is no '.git' in the environment, $psscriptroot is the default location to look for the solution and log file
2018-09-17 16:04:13 -07:00
Yanbing 48e0cdbd5f
Grant Built-in-Users to log event to channels (#339)
Fix of PowerShell/Win32-OpenSSH#1174 to grant non-admin permission to log events
Change the file type to text so it will show the diff in the future
2018-08-11 00:45:48 -07:00
bingbing8 38fc68a21b Grant built-in-user TRACE_LOG_EVENT permission
change the file to text type to show the diff
2018-08-11 00:12:50 -07:00
Yanbing 4ac87b4991
Upload unit test as artifacts (#337)
Update vsts scripts to upload unit tests as artifacts
2018-08-06 12:57:47 -07:00
Yanbing 0f9808f190
Cranked version 7.7.2.0 (#334)
Cranked version 7.7.2.0
2018-07-26 11:03:08 -07:00
Manoj Ampalam 84e87be8ae
ConPTY changes and support for auto-updating known_hosts;
- Logic to support conpty (currently disabled until validation is complete)
- fdopen() and fchmod() support for file handles
- support for auto updating known_hosts via ssh and ssh-keygen
- Support for dynamic Windows-size changes with PTY
- Changes to support OneCore SDK
- Test cases
2018-07-25 15:15:05 -07:00
Manoj Ampalam 8bb672aa4d
Optimized group membership resolution (#327)
Current group membership resolution though very effective, is very slow. In a typical domain joined enterprise machine, adding a simple entry like the following in sshd_config
AllowGroups administrators
will incur a long delay in remote session establishment as sshd tried to pull all groups associated with the domain user.

Changes in this PR optimize the general case scenarios where no wild cards are in use. Specifically rules like this are processed promptly:

AllowGroups group1, group2, group3 //with no wild cards
Match Group group1 //single group with no negation and wild cards

Optimization is done by resolve the groupname in rule immediately to SID and checking its membership against user token. Enumerating the entire group membership is done on a lazy on-demand basis.

Beyond the optimization, there are 2 functional changes

- removed domain prefix for builtin groups
- removed domain prefix'ed versions of local groups since we are strictly following the convention that local principals shouldn't have any domain qualification.
2018-07-03 10:15:07 -07:00
Yanbing ed70a1a7f8
Add debug msg, replace API call incompatible with onecore , add build script (#324)
Add debug msg, replace API call incompatible with onecore , add build script
2018-06-18 22:39:31 -07:00
Manoj Ampalam 9369d870ad
upped version to 7.7.1.0 and fixed some issues with session path resolution (#320)
upped version to 7.7.1.0 and fixed some issues with session path resolution
2018-06-04 21:15:18 -07:00
bagajjal 8013f1377b implement freezero(), use localtime_s() instead of localtime() (#300)
PowerShell/Win32-OpenSSH#1121
2018-05-29 19:00:56 -07:00
Manoj Ampalam 8c9c6a0e17
fixed product version (#315) 2018-05-29 10:55:32 -07:00
Manoj Ampalam 9ff97f6106
Fixed issue with virtual token generation (#314)
On certain machines, virtual tokens were not getting generated due to lack of required privileges. Fixed it by assigning them before doing LogonUserExExW. Consolidated runtime dll loading logic. 

PowerShell/Win32-OpenSSH#1162
2018-05-28 22:03:33 -07:00
Yanbing a479737cd5
Buffer overflow in Scp (#310)
1. Fix buffer overflow in scp
2. Update setup tests to take into account the windows inbox service startup type
2018-05-20 19:06:36 -07:00
Dominic Watley 936b89ac0d Add GCM Cipher Support (#309)
Enabled GCM Cipher related macros in config header for Windows
PowerShell/Win32-OpenSSH#1075
2018-05-10 21:20:55 -07:00
Bryan Berns fe422e5c15 Enhanced Group Discovery / Normalized Names (#286)
Modified getusergroups() to use s4u tokens to discover nested groups and return them in NetBiosName\GroupName format.
Modified get_passwd() to internally normalize names to NetBiosName\SamAccountName format and changed functions that use it to translate to UPN where necessary.
Removed unnecessary support functions used by previous version of getusergroups().
Various refactoring and function consolidation / simplification.
Addressed several buffer over-read issues.

PowerShell/Win32-OpenSSH#553
2018-05-01 23:20:42 -07:00
Yanbing ec3eb7a088
Fix issue install-sshd.ps1 failed on Nano, update it to match inbox manifest, and add setup and uninstall tests (#305)
1. Fix issue install-sshd.ps1 failed on Nano
2. Update settings of services in install-sshd.ps1 to match windows inbox
3. added setup tests and update the test helper scripts to run setup tests before changing configurations on the machine
4. added uninstallation tests
2018-04-24 11:50:44 -07:00
Yanbing 41e4e89376
Add support to take key files with CRLF new line ending on windows (#301)
1. Add support to take key files with windows new line ending (PowerShell/Win32-OpenSSH#1130)
2. add test cases for CRLF
3. Update test helper script to catch the exitcode of unittest and report the failure
4. Enable uni test unittest-sshkey and unittest-sshkey
5. Disable resource check for signal tests due to some API issue to follow.
6. Remove workaround for windows new line ending in test scripts
7. Add test validation for ACL of registry entries when perform ssh-add
2018-04-12 14:24:38 -07:00
Manoj Ampalam 32a7aec453 Ported upstream changes (7.7) 2018-04-02 22:30:15 -07:00
Manoj Ampalam c1aaa5d5a3 updates to uninstall-sshd.ps1, cranked version to 7.6.1.0 (#295) 2018-03-30 19:45:11 -07:00
Yanbing f291d2438f
Added config files to enabled VSTS build, compliance tests, Code signing. (#296)
Added config files to enabled VSTS build, compliance tests, Code signing.
2018-03-30 19:44:07 -07:00
bagajjal 00b869dbd8 Use libre ssl official release binaries (#294)
- Use LibreSSL release binaries. Update paths.target
- Update paths.targets to remove onecore specific changes
- Minor changes
2018-03-29 10:23:05 -07:00
Yanbing 952650633d
Update compiler and link options (#293)
* add additionaloptions for ClCompiler and linker for APIscan compliance test
2018-03-26 16:21:56 -07:00
Bryan Berns 0dc5a971bd Allow More Child Processes (#284)
- Added wait_for_multiple_objects_enhanced() function that can logically handle wait-any on many children (system resources permitting).
- Added unit tests for wait_for_multiple_objects_enhanced().
- Incorporated use of wait_for_multiple_objects_enhanced() into main signal handler.
- Upped max child processes to 500.
2018-03-14 11:10:27 -07:00
Yanbing fb1342f7e0
Add wildcard support for scp (#283)
1. Expand wildcard for input parameters
2.  add scp tests with wildcard
3. for debug mode, need to enable the log to local log file.
4. update the path to log file
2018-03-11 23:28:52 -07:00
Manoj Ampalam 9fe39c0c73
Fixed regression caused due to ETW support changes (#282)
Regression: Service is unable to start if "ssh" programdata directory is missing.
Reason: This is due to refactored changes around w32_programdir() that moved its initialization to within win32_posix_initialize. sshd_main() is relying on this call even before the POSIX layer gets initialized.
Fix: Reverted the refactoring changes and added comments to consolidate these changes later. Also removed directory creation logic in install-sshd.ps1 that masked this issue before.
2018-03-09 14:56:47 -08:00
Manoj Ampalam 2c559a2b6c
Added support for ETW based logging (#280)
https://github.com/PowerShell/Win32-OpenSSH/issues/95
2018-03-06 15:33:19 -08:00
Yanbing 50a4badb79
Test Fixes on down level OS (#279)
* Test Fixes on downlevel machines
1. Test fix to run on win7 and win8
2. Add -onecore parameter to start-opensshpackage in build helper script
3. Add copying of libcrypto.dll and libcrypto.pdb
4. Update the build number on appveyor.yml
2018-03-01 15:11:55 -08:00
Yanbing f46d8d1b30
build script update: use vs2017 if it exists; fall back to vs2015 if 2017 does not presents (#277)
* add NoOpenSSL and OneCore parameter for packaging

* update the log option so it can print out the build console log

* update script to use vs2017 if it exists

* update path to copy libcrypto.dll
2018-02-27 14:01:45 -08:00
Manoj Ampalam 89cac52637
onboarding fileversion, productversion and softwareversion changes (#274)
Updated file version info:
FileVersionRaw : 7.6.0.0
ProductVersionRaw : 7.6.0.0
ProductName : OpenSSH for Windows
ProductVersion : OpenSSH_7.6p1 for Windows

Updated softwareversion - this would show up in protocol identification string and when doing ssh -V
OpenSSH_for_Windows_7.6
2018-02-20 23:02:04 -08:00
Manoj Ampalam 05d1975743
Added logic to spawn unauthenticated sshd workers to run in isolated … (#275)
Issue: All SSHD unauthenticated workers are currently running as "sshd". Any compromised worker can snoop into the process space of one other worker, steal authentication payload and elevate itself.
Fix: Added logic to spawn the unauthenticated workers under the context of run time unique security identities that will provide complete isolation between these worker processes.
2018-02-20 23:00:14 -08:00
Manoj Ampalam 02d07309e2
Now logging sshd.pid at %programdata%\ssh (#269)
PowerShell/Win32-OpenSSH#982
2018-01-29 21:59:48 -08:00