Commit Graph

10062 Commits

Author SHA1 Message Date
Manoj Ampalam aaf11e2149
Fixed various unhandled failure paths in Kerb GSS/SSPI adapter (#393) 2019-10-10 11:42:28 -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 675e761d75
Pass prompted message to SSH_ASKPASS command line
Issue: The msg parameter provided to the ssh_askpass function is not forwarded to the command specified by SSH_ASKPASS. This parameter specifies a prompt that should be forwarded as a command line argument to the SSH_ASKPASS-specified command. The logic is correct in the fork-based version but not the posix_spawn-based version of the code.

Fix: Change posix_spawn arguments to include prompt message
2019-09-12 12:06:03 -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
Bryan Berns 8346fc0d43 Correct Unicode Path Handling (#388)
Adjusted realpath() to use _wfullpath() to handle cases where paths may contain unicode characters.
Addresses PowerShell/Win32-OpenSSH#1401.
2019-07-16 11:42:02 -07:00
denmor86 5cfe075fb3 Ensure compat part of version exchange is accounted in KEX
Fix: Pass on compat info from monitor to child worker processes
2019-07-16 11:23:30 -07:00
Bryan Berns b68e74d05c Address GSSAPI Crash When Non-Domain User Is Specified (#385)
Updated gss_release_cred() to test if passed structure is actually a logon token and, if so, release the data properly.
Addresses PowerShell/Win32-OpenSSH#1405
2019-06-27 11:00:57 -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
Bryan Berns 3d35b912a7 Updated Permissions Check For SidHistory (#375)
- Updated check_secure_file_permission() to perform a reverse lookups on the trustee SID within the file security descriptor to account for multiple SIDs that actually point to the same user.
- Updated permissions message to display the resolved SID to help with end user debugging.

Addresses: PowerShell/Win32-OpenSSH#1342
2019-06-10 12:30:11 -07:00
Manoj Ampalam 7ed284f878
Ported v8.0 changes 2019-05-24 23:08:06 -07:00
Manoj Ampalam 7079aed39c Merge branch 'V_8_0' of https://github.com/openssh/openssh-portable 2019-05-22 14:18:23 -07:00
bugale c9c6da0bee Added keystroke mapping Shift+Tab in shellhost (#367) 2019-05-21 14:03:53 -07:00
Bryan Berns 18884b29fd Addressed Thread Hanging Issue (#374)
- Replaced TerminateThread() call with an interrupt routine to gracefully call _endthreadex(0).
- Resolves https://github.com/PowerShell/Win32-OpenSSH/issues/1338.
2019-05-21 13:56:59 -07:00
Manoj Ampalam 8d7ab2b801
Fix issue with ProxyJump on Windows
ProxyJump commandline constructed by ssh following Unix commandline argument convention using single quotes. Added a #ifdef block to use double quotes for Windows. 
https://github.com/PowerShell/Win32-OpenSSH/issues/1172
2019-05-21 13:43:15 -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 bfd4ddf194
Account for dev/null being reported as a terminal handle
https://github.com/PowerShell/Win32-OpenSSH/issues/1330

Issue: open(dev/nul) returns a handle is passes isatty() test (i.e its being treated as a terminal handle by OS). This handle seems to work fine for as a console handle for console APIs, except when NUL is explicitly redirected. 
This works
ssh -n target hostname

but this hangs due to a deadlock from writing a log entry on a console API failure
ssh -n target hostname < NUL

Fix: Ignore console API failures when the handle is being reported as invalid.
2019-05-21 13:25:49 -07:00
Bryan Berns 22cc95e986 Fixed fileio_fdopen() to simply return the file descriptor for non-disk file types
Addresses issue where an error message in SCP (server side) was not being returned to the pipe which causes the process to hang.  Resolves: https://github.com/PowerShell/Win32-OpenSSH/issues/1345
2019-05-21 13:22:54 -07:00
Chris Spencer 3449eb2152 Added dlerror() and fixed issue with dlopen() handling UTF-8 filenames
dlerror() is supposed to return a char *, but currently returns a
DWORD. Reimplement it using the Win32 FormatMessage function.
Correctly handle UTF-8 filenames in the Win32 implementation of dlopen()
2019-05-21 13:02:53 -07:00
Bryan Berns 959cbe3265 Allow Console Output In UTF-8 (#378)
- Address issue where console output does not display UTF-8 string properly.
- Resolves https://github.com/PowerShell/Win32-OpenSSH/issues/1225
2019-05-20 14:51:05 -07:00
djm@openbsd.org 85cf2488d4 upstream: embiggen format buffer size for certificate serial number so
that it will fit a full 64 bit integer. bz#3012 from Manoel Domingues Junior

OpenBSD-Commit-ID: a51f3013056d05b976e5af6b978dcb9e27bbc12b
2019-05-20 10:28:21 +10:00
Darren Tucker 22bdbc7111 Add no-op implementation of pam_putenv.
Some platforms such as HP-UX do not have pam_putenv.  Currently the
calls are ifdef'ed out, but a new one was recently added.  Remove the
ifdefs and add a no-op implementation.  bz#3008, ok djm.
2019-05-17 13:22:26 +10:00
Darren Tucker 7a40c713f9 Don't install duplicate STREAMS modules on Solaris
Check if STREAMS modules are already installed on pty before installing
since when compiling with XPG>=4 they will likely be installed already.
Prevents hangs and duplicate lines on the terminal.  bz#2945 and bz#2998,
patch from djm@
2019-04-26 18:16:41 +10:00
Damien Miller fd0fa130ec makedepend 2019-04-18 08:52:57 +10:00
Damien Miller 5de397a876 second thoughts: leave README in place
A number of contrib/* files refer to the existing README so let's leave
it in place for release and add the new markdown version in parallel.

I'll get rid of README after release.
2019-04-05 11:29:51 -07:00
Damien Miller 5d3127d927 Revert "rewrite README"
This reverts commit 9444d82678.
2019-04-05 11:29:31 -07:00
Damien Miller 9444d82678 rewrite README
Include basic build instructions and comments on commonly-used build-
time flags, links to the manual pages and other resources.

Now in Markdown format for better viewing on github, etc.
2019-04-05 11:26:35 -07:00
Damien Miller a924de0c49 update versions 2019-04-05 03:41:52 +11:00
djm@openbsd.org 312dcee739 upstream: openssh-8.0
OpenBSD-Commit-ID: 5aafdf218679dab982fea20771afd643be9a127b
2019-04-05 03:39:46 +11:00
Damien Miller 885bc11469 session: Do not use removed API
from Jakub Jelen
2019-04-04 02:47:40 +11:00
djm@openbsd.org 9d7b2882b0 upstream: when logging/fataling on error, include a bit more detail
than just the function name and the error message

OpenBSD-Commit-ID: dd72d7eba2215fcb89be516c378f633ea5bcca9f
2019-04-03 09:34:03 +11:00
Darren Tucker 79a87d3278 Remove "struct ssh" from sys_auth_record_login.
It's not needed, and is not available from the call site in loginrec.c
Should only affect AIX, spotted by Kevin Brott.
2019-04-03 06:27:45 +11:00
Darren Tucker 138c0d52cd Adapt custom_failed_login to new prototype.
Spotted by Kevin Brott.
2019-04-02 18:21:35 +11:00
Darren Tucker a0ca4009ab Add includes.h for compat layer.
Should fix build on AIX 7.2.
2019-04-01 20:07:23 +11:00
Tim Rice 0099115178 Stop USL compilers for erroring with "integral constant expression expected" 2019-03-31 22:14:22 -07:00
Tim Rice 43f47ebbdd Only use O_NOFOLLOW in fchownat and fchmodat if defined 2019-03-31 19:22:19 -07:00
Jakub Jelen 342d6e5158 Adjust softhsm2 path on Fedora Linux for regress
The SoftHSM lives in Fedora in /usr/lib64/pkcs11/libsofthsm2.so
2019-03-29 22:37:15 +11:00
Darren Tucker f5abb05f8c Only use O_NOFOLLOW in utimensat if defined.
Fixes build on systems that don't have it (Solaris <=9)  Found by
Tom G. Christensen.
2019-03-28 09:26:14 +11:00
Corinna Vinschen 786cd4c183 drop old Cygwin considerations
- Cygwin supports non-DOS characters in filenames
- Cygwin does not support Windows XP anymore

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2019-03-28 09:23:46 +11:00
djm@openbsd.org 21da87f439 upstream: fix interaction between ClientAliveInterval and RekeyLimit
that could cause connection to close incorrectly; Report and patch from Jakub
Jelen in bz#2757; ok dtucker@ markus@

OpenBSD-Commit-ID: 17229a8a65bd8e6c2080318ec2b7a61e1aede3fb
2019-03-27 20:30:58 +11:00
djm@openbsd.org 4f0019a9af upstream: Fix authentication failures when "AuthenticationMethods
any" in a Match block overrides a more restrictive global default.

Spotted by jmc@, ok markus@

OpenBSD-Commit-ID: a90a4fe2ab81d0eeeb8fdfc21af81f7eabda6666
2019-03-26 10:20:41 +11:00
djm@openbsd.org d6e5def308 upstream: whitespace
OpenBSD-Commit-ID: 106e853ae8a477e8385bc53824d3884a8159db07
2019-03-26 10:20:41 +11:00
dtucker@openbsd.org 26e0cef07b upstream: Expand comment to document rationale for default key
sizes. "seems worthwhile" deraadt.

OpenBSD-Commit-ID: 72e5c0983d7da1fb72f191870f36cb58263a2456
2019-03-26 10:20:22 +11:00
dtucker@openbsd.org f47269ea67 upstream: Increase the default RSA key size to 3072 bits. Based on
the estimates from NIST Special Publication 800-57, 3k bits provides security
equivalent to 128 bits which is the smallest symmetric cipher we enable by
default. ok markus@ deraadt@

OpenBSD-Commit-ID: 461dd32ebe808f88f4fc3ec74749b0e6bef2276b
2019-03-26 10:20:22 +11:00
jmc@openbsd.org 62949c5b37 upstream: full stop in the wrong place;
OpenBSD-Commit-ID: 478a0567c83553a2aebf95d0f1bd67ac1b1253e4
2019-03-26 10:20:22 +11:00
jmc@openbsd.org 1b1332b5bb upstream: benno helped me clean up the tcp forwarding section;
OpenBSD-Commit-ID: d4bec27edefde636fb632b7f0b7c656b9c7b7f08
2019-03-26 10:20:22 +11:00
markus@openbsd.org 2aee9a49f6 upstream: fix use-after-free in ssh-pkcs11; found by hshoexer w/AFL
OpenBSD-Commit-ID: febce81cca72b71f70513fbee4ff52ca050f675c
2019-03-26 10:20:22 +11:00
Bryan Berns afe4880c37 Address Group Matching Issue (#380)
- Addressed group mapping issue caused by the username being used after being freed.
PowerShell/Win32-OpenSSH#1354
2019-03-25 09:59:38 -07:00
Bryan Berns 2abb7748a9 Address Renaming Issue With exFAT File Systems (#381)
- Updated Win32 error translation table to translate ERROR_INVALID_FUNCTION as EOPNOTSUPP which in turn allows the SFTP rename capability to failover to rename() when link()/unlink() combination does not work due to the volume not supporting it.
- Addressed file security descriptor with no defined DACL.
PowerShell/Win32-OpenSSH#1357
2019-03-25 09:53:23 -07:00
Darren Tucker 9edbd7821e Fix build when configured --without-openssl.
ok djm@
2019-03-14 10:17:28 +11:00
Darren Tucker 825ab32f0d On Cygwin run sshd as SYSTEM where possible.
Seteuid now creates user token using S4U.  We don't create a token
from scratch anymore, so we don't need the "Create a process token"
privilege.  The service can run under SYSTEM again...

...unless Cygwin is running on Windows Vista or Windows 7 in the
WOW64 32 bit emulation layer.  It turns out that WOW64 on these systems
didn't implement MsV1_0 S4U Logon so we still need the fallback
to NtCreateToken for these systems.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2019-03-14 08:51:17 +11:00