Commit Graph

763 Commits

Author SHA1 Message Date
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 fde0994a30
fix test failures on win7 (#335) 2018-08-01 12:31:10 -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 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
Manoj Ampalam 1e0c864707
session process path changes (#319)
Added utility to build session process command line - this accounts for restrictions from various shells. With these changes, scp and sftp-server are expected to be machine wide PATH if a custom shell (other than cmd.exe) is defined. Added comprehensive test cases.
Fixed issue with USERNAME env variable containing domain prefix too.

PowerShell/Win32-OpenSSH#1165
PowerShell/Win32-OpenSSH#1165
PowerShell/Win32-OpenSSH#1171
2018-06-04 12:16:13 -07:00
Bryan Berns 710050b186 Remove None/Domain Users Group Filter (#316)
- Removed logic that was excluding the group membership SID that matched 'None' on workgroup computers or 'Domain Users' on domain systems.
- Removed test that was checking that AllowGroups failure if user was not in any group at all.  This is no longer testable since user will always be a member of at least one group.

https://github.com/PowerShell/Win32-OpenSSH/issues/1167
2018-06-03 08:23:30 -07:00
Bryan Berns ec102dce28 Alternate Thread Creation API To Avoid Memory Leaks (#306)
* Alternate Thread Creation API To Avoid Memory Leaks

- Switched from CreateThread() to _beginthreadex() and ExitThread() to _endthreadex() in order to avoid potential leaks when linking with static CRT library.
- Addressed a variety of warnings that were being detected with static code analysis.

* Addressed Type Cast Warning

- Added explicit cast to the output of _beginthreadex() to avoid a compiler warning.

* Indentation Fix
2018-05-23 16:53:36 -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
Manoj Ampalam 7b28a316eb
Enable SFTP chroot support (#308)
- Added chroot implementation that simply stores the path in internal state and sets an environment variable
- Spawned processes pickup chroot from environment variable
- Core change in realpath and resolved_path_utf16 now take into account chroot path.
- Unit tests
- Other miscellaneous changes to account for chroot enabled logic in core code

PowerShell/Win32-OpenSSH#190
PowerShell/Win32-OpenSSH#292
2018-05-11 14:45:20 -07:00
Manoj Ampalam 77999d2f4d
Merge pull request #303 from NoMoreFood/path_fixes
Reworked resolved_path() into resolved_path_utf16() that combined utf16 conversion and path conditioning into a single function. This eliminated the previously non-threadsafe resolved_path() function that used a static buffer. Changed some functions to use unicode to eliminate use of previous resolve_path function.
Adjusted functions to use resolved_path_utf16().
Collapsed copy_file() function that was only used once.
Corrected compilation errors when debug4() and debug5() are enabled.
Removed debug statements that were interfering with APC wakeup due to the way that logging works in atomicio6().
Filled in a missing parameter in a debug statement.
Changed test helper so test name is displayed when running release build.
Corrected permissions check for whether to run symbolic links in test cases.
Removed TEST_RESOURCES() in unit tests calls due to inconsistent ability to sample handles in Windows 8.1 / Server 2012 R2.
2018-04-25 22:03:52 -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
Bryan Berns 808a4ac5ce
Merge branch 'latestw_all' into path_fixes 2018-04-24 05:11:43 -04:00
Bryan Berns f6554dcb1c Add Hard Link Unit Tests
- Added unit test cases to validate link() functionality using relative/absolute and unicode/ascii parameters.
2018-04-19 03:09:04 -04: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 2474b9130b Merge branch 'master' of https://github.com/openssh/openssh-portable into up_merge 2018-04-02 13:13:47 -07:00
Bryan Berns bd6408058a Reworked Path Resolution Function
- Reworked resolved_path() into resolved_path_utf16() that combined utf16 conversion and path conditioning into a single function.  This eliminated the previously non-threadsafe resolved_path() function.
- Adjusted functions to use resolved_path_utf16().
- Collapsed copy_file() function that was only used once.
- Corrected compilation errors when debug4() and debug5() are enabled.
2018-04-01 23:41:09 -04:00
Bryan Berns 993cce0798 Added symlink() Implementation; Revised readlink() (#289)
- Added implementation of symlink() using native CreateSymbolicLink() function.
- Added unit tests for symlink behavior in readlink(), lstat, stat(), and symlink().
- Reworked readlink() to be more inline with POSIX readlink() behavior.
- Reworked symlink handling in stat/lstat due to revised readlink().
- Added additional error handling to readlink().
- Added symlink() Implementation - Memory Leak Fix
- Modified fileio_readlink() to properly free a temporary buffer it creates.
2018-03-29 10:54:38 -07:00
Damien Miller 4b7d8acdbb Remove authinfo.sh test dependency on printenv
Some platforms lack printenv in the default $PATH.
Reported by Tom G. Christensen
2018-03-26 09:38:44 +11:00
Darren Tucker 393436024d Replace /dev/stdin with "-".
For some reason sftp -b doesn't work with /dev/stdin on Cygwin, as noted
and suggested by vinschen at redhat.com.
2018-03-25 09:40:46 +11:00
Darren Tucker b5974de1a1 Provide $OBJ to paths in PuTTY interop tests. 2018-03-23 13:21:14 +11:00
dtucker@openbsd.org dc31e79454 upstream: Tell puttygen to use /dev/urandom instead of /dev/random. On
OpenBSD they are both non-blocking, but on many other -portable platforms it
blocks, stalling tests.

OpenBSD-Regress-ID: 397d0d4c719c353f24d79f5b14775e0cfdf0e1cc
2018-03-23 11:05:39 +11:00
Darren Tucker c6cb2565c9 Save $? before case statement.
In some shells (FreeBSD 9, ash) the case statement resets $?, so save
for later testing.
2018-03-22 17:00:28 +11:00
Bryan Berns 966d8c4129 Unit Test Updates / Small Bug Fixes (#288)
- Updated socketio_WSARecv() to prevent attempted buffer overrun.
- Updated w32_rename() to handle error when input parameters are null.
- Updated file verify success on dup() test.
2018-03-16 09:32:26 -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
djm@openbsd.org 4c4e7f783b upstream: rename recently-added "valid-before" key restriction to
"expiry-time" as the former is confusing wrt similar terminology in X.509;
pointed out by jsing@

OpenBSD-Regress-ID: ac8b41dbfd90cffd525d58350c327195b0937793
2018-03-14 18:55:47 +11:00
djm@openbsd.org 500396b204 upstream: check valid-before option in authorized_keys
OpenBSD-Regress-ID: 7e1e4a84f7f099a290e5a4cbf4196f90ff2d7e11
2018-03-14 18:55:47 +11:00
djm@openbsd.org a76b5d26c2 upstream: explicitly specify RSA/SHA-2 keytype here too
OpenBSD-Regress-ID: 74d7b24e8c72c27af6b481198344eb077e993a62
2018-03-14 18:55:47 +11:00
djm@openbsd.org 3a43297ce2 upstream: exlicitly include RSA/SHA-2 keytypes in
PubkeyAcceptedKeyTypes here

OpenBSD-Regress-ID: 954d19e0032a74e31697fb1dc7e7d3d1b2d65fe9
2018-03-14 18:55:47 +11: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
djm@openbsd.org 7e4fadd324 upstream: for the pty control tests, just check that the PTY path
points to something in /dev (rather than checking the device node itself);
makes life easier for portable, where systems with dynamic ptys can delete
nodes before we get around to testing their existence.

OpenBSD-Regress-ID: b1e455b821e62572bccd98102f8dd9d09bb94994
2018-03-04 12:47:42 +11:00
djm@openbsd.org de1920d743 upstream: unit tests for new authorized_keys options API
OpenBSD-Regress-ID: 820f9ec9c6301f6ca330ad4052d85f0e67d0bdc1
2018-03-03 14:39:25 +11:00
djm@openbsd.org dc3e92df17 upstream: fix testing of pty option, include positive test and
testing of restrict keyword

OpenBSD-Regress-ID: 4268f27c2706a0a95e725d9518c5bcbec9814c6d
2018-03-03 14:38:26 +11:00
djm@openbsd.org 3d1edd1ebb upstream: better testing for port-forwarding and restrict flags in
authorized_keys

OpenBSD-Regress-ID: ee771df8955f2735df54746872c6228aff381daa
2018-03-03 14:38:26 +11: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
Damien Miller a8dd6fe0aa space before tab in previous 2018-02-23 14:19:55 +11:00
dtucker@openbsd.org b5e9263c77 upstream: Replace fatal with exit in the case that we do not have
$SUDO set. Prevents test failures when neither sudo nor doas are configured.

OpenBSD-Regress-ID: 6a0464decc4f8ac7d6eded556a032b0fc521bc7b
2018-02-23 14:18:25 +11:00
djm@openbsd.org 73282b6118 upstream: unbreak interop test after SSHv1 purge; patch from Colin
Watson via bz#2823

OpenBSD-Regress-ID: 807d30a597756ed6612bdf46dfebca74f49cb31a
2018-02-23 14:07:23 +11:00
dtucker@openbsd.org f8985dde5f upstream: Skip sftp-chroot test when SUDO not set instead of
fatal().

OpenBSD-Regress-ID: cd4b5f1109b0dc09af4e5ea7d4968c43fbcbde88
2018-02-23 14:07:23 +11:00
dtucker@openbsd.org df88551c02 upstream: Replace fatal with exit in the case that we do not have
$SUDO set. Prevents test failures when neither sudo nor doas are configured.

OpenBSD-Regress-ID: 6a0464decc4f8ac7d6eded556a032b0fc521bc7b
2018-02-23 14:05:33 +11:00
djm@openbsd.org 3b252c20b1 upstream: some helpers to check verbose/quiet mode
OpenBSD-Regress-ID: e736aac39e563f5360a0935080a71d5fdcb976de
2018-02-23 14:05:07 +11:00
Manoj Ampalam b3a3a5cc66
Multiple Fixes (#273)
PowerShell/Win32-OpenSSH#1065
Fix: In recent sshd architectural changes, post authentication changes that process user specific changes were missing in authenticated sshd worker. Added missing call.
PowerShell/Win32-OpenSSH#1052
Fix: getpwd* functions will now strip off domain of any local user account.
2018-02-21 10:09:18 -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
Darren Tucker affa6ba67f Remove execute bit from modpipe.c. 2018-02-15 22:33:21 +11:00
Darren Tucker 265d88d4e6 Remove remaining now-obsolete cvs $Ids. 2018-02-15 20:06:19 +11:00
Darren Tucker aee49b2a89 Set SO_REUSEADDR in regression test netcat.
Sometimes multiplex tests fail on Solaris with "netcat: local_listen:
Address already in use" which is likely due to previous invocations
leaving the port in TIME_WAIT.  Set SO_REUSEADDR (in addition to
SO_REUSEPORT which is alread set on platforms that support it).  ok djm@
2018-02-08 12:42:12 +11:00
Yanbing bad5548188
Test update
1. Move Start-SSHD-TestDaemon and Stop-SSHD-TestDaemon to commonUtils.psm1
2. Fix the timing issue when trying to read the log while it is still locked by the process.
3, Start the service to create the config fold if it is not there.
4. Skip authorizedkey and sshdconfig tests on win7 since the task scheduler cmdlets are not available on win7.
5. rename variables
2018-01-29 13:49:01 -08:00
bagajjal b92b7c9480 fix the sshd_config and test related changes (#265)
fix the sshd_config and test related changes
2018-01-22 18:53:17 -08:00
bagajjal c85ba2b8c3 Separate binary path from cfg path and log path (#263)
Separate binary path from cfg path and log path, test update
2018-01-19 15:12:43 -08:00
Manoj Ampalam fdd54b6334
Implement Unix styled privilege separation in Windows (#258)
OpenSSh privilege separation model - http://www.citi.umich.edu/u/provos/ssh/privsep.html 
Posix_spawn is implemented in POSIX adapter as an alternative to fork() that is heavily used in Privilege separation. 
Additional state info is added to sshd to accommodate distinguishing the various modes (privileged monitor, unprivileged child, authenticated child).
Required service state (like config and host keys) is transmitted over pipes from monitor to child processes.
Changes to installation scripts and tests to accomodate new architectural changes
2018-01-15 13:57:31 -08:00
Damien Miller 4f29309c4c unbreak fuzz harness 2018-01-03 19:50:43 +11:00