Commit Graph

9785 Commits

Author SHA1 Message Date
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
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
Manoj Ampalam 68ad673db4
Workaround for PTY regressions
Changes from #353 enabled closing of previously duplicated Console handles - this is causing TTY rendering issues in ssh.exe.
Added a workaround for now to skip closing Console handles.
2019-01-11 12:19:39 -08: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
Manoj Ampalam 495db5b7e4
Fixes to ssh-agent issues
PowerShell/Win32-OpenSSH#1263
Issue: ssh-agent is using default sign algorithm, without considering related flags in request
Fix: parse flags and consider sign algorithm input

PowerShell/Win32-OpenSSH#1234
Issue: ssh-agent has old logic to lookup sshd account
Fix: remove this redundant logic
2019-01-05 13:16:51 -08:00
Yan Tesis c6fa13b82e Fix listing agent keys with forwarded agent (#363)
Gracefully fail SSH1 agent requests
2019-01-04 23:44:34 -08:00
Yanbing 54b0ce9b56
fix of issue 1290 (#358)
Fix processid assignment, memory leak and handle leaks on conpty session.
2018-11-16 15:36:31 -08:00
Manoj Ampalam 83bff88b24
Fix Console handle leaks (#357)
Issue: Earlier change missed "return" calls that will end up ignoring singleton logic and re-running console handle generation logic multiple times, leaking previously created handles in the process.

Fix: Add the missing "return" calls
2018-11-15 13:33:22 -08:00
bagajjal 4666c11e0e
Use kernerl32.dll instead of kernelbase.dll for checking conpty support (#356) 2018-11-14 14:49:24 -08:00
Manoj Ampalam 5faac25142
Fixes to PTY session regressions
With recent changes, PTY sessions are no longer working. The issue is due to TTY code in ssh.exe assuming that stdin and stdout are console handles. The reality could be different since these handles always are dup'ed or closed for other reasons.
Fix involves extracting console handles via CreateFile(CONIN\CONOUT).
2018-11-07 12:30:57 -08:00
bagajjal 6cacff8a74 dynamically check for conpty support (#352) 2018-11-07 12:29:29 -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 cc16f80123
Converge fork and upstream branches
- Removed #ifdef WINDOWS blocks in base code where the feature support can be conveyed by a failed POSIX API call
- Refactored password authentication code
- Other misc changes - Removed DebugBreak on Release Builds
2018-10-30 14:54:13 -07:00
bagajjal 8ff5517c3a
Fix unicode rendering issue at ssh client (#338) 2018-10-26 10:31:38 -07: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 77a35d0b0d
Remove sshd account dependency (#348)
In Windows, unprivileged worker runs as a runtime generated virtual account. There should be no requirement to have a real account under the name of unprivileged user (sshd).
2018-10-23 22:31:08 +05:30
Darren Tucker 55d7cdda4d Include openssl compatibility.
Patch from rosenp at gmail.com via openssh-unix-dev.
2018-10-22 20:07:09 +11:00
Damien Miller 631165f6c4 fix compile for openssl 1.0.x w/ --with-ssl-engine
bz#2921, patch from cotequeiroz
2018-10-22 11:23:42 +11:00
Damien Miller aede1c3424 Require OpenSSL 1.1.x series 1.1.0g or greater
Previous versions have a bug with EVP_CipherInit() when passed a
NULL EVP_CIPHER, per https://github.com/openssl/openssl/pull/4613

ok dtucker@
2018-10-17 11:01:20 +11:00
Damien Miller 08300c2114 unbreak compilation with --with-ssl-engine
Missing last argument to OPENSSL_init_crypto()
2018-10-17 08:12:02 +11:00
Darren Tucker 1673274aee Remove gcc spectre mitigation flags.
Current impementions of the gcc spectre mitigation flags cause
miscompilations when combined with other flags and do not provide much
protection.  Found by fweimer at redhat.com, ok djm@
2018-10-16 14:45:57 +11:00
Damien Miller 4e23deefd7 Avoid deprecated OPENSSL_config when using 1.1.x
OpenSSL 1.1.x soft-deprecated OPENSSL_config in favour of
OPENSSL_init_crypto; pointed out by Jakub Jelen
2018-10-16 10:54:37 +11:00
Darren Tucker 797cdd9c84 Don't avoid our *sprintf replacements.
Don't let systems with broken printf(3) avoid our replacements
via asprintf(3)/vasprintf(3) calling libc internally.  From djm@
2018-10-12 16:58:47 +11:00
Darren Tucker e526127cbd Check if snprintf understands %zu.
If the platforms snprintf and friends don't understand %zu, use the
compat replacement.  Prevents segfaults on those platforms.
2018-10-12 16:43:35 +11:00
Damien Miller cf39f87519 remove stale link, tweak 2018-10-12 09:48:05 +11:00
Damien Miller a7205e68de update version numbers ahead of release 2018-10-12 09:47:20 +11:00
djm@openbsd.org 1a4a9cf80f upstream: don't send new-style rsa-sha2-*-cert-v01@openssh.com names to
older OpenSSH that can't handle them. spotted by Adam Eijdenberg; ok dtucker

OpenBSD-Commit-ID: 662bbc402e3d7c9b6c322806269698106a6ae631
2018-10-12 09:43:30 +11:00
Damien Miller dc8ddcdf1a update depends 2018-10-11 13:08:59 +11:00
Damien Miller 26841ac265 some more duplicated key algorithm lines
From Adam Eijdenberg
2018-10-11 13:02:11 +11:00
Damien Miller 5d9d17603b fix duplicated algorithm specification lines
Spotted by Adam Eijdenberg
2018-10-11 11:56:36 +11:00
djm@openbsd.org ebfafd9c7a upstream: typo in plain RSA algorithm counterpart names for
certificates; spotted by Adam Eijdenberg; ok dtucker@

OpenBSD-Commit-ID: bfcdeb6f4fc9e7607f5096574c8f118f2e709e00
2018-10-11 11:55:57 +11:00
Damien Miller c29b111e7d check pw_passwd != NULL here too
Again, for systems with broken NIS implementations.

Prompted by coolbugcheckers AT gmail.com
2018-10-11 11:29:35 +11:00
Damien Miller fe8e8f349a check for NULL return from shadow_pw()
probably unreachable on this platform; pointed out by
coolbugcheckers AT gmail.com
2018-10-11 11:03:54 +11:00
deraadt@openbsd.org acc59cbe7a upstream: introducing openssh 7.9
OpenBSD-Commit-ID: 42d526a9fe01a40dd299ac58014d3349adf40e25
2018-10-11 11:03:53 +11:00
Damien Miller 12731158c7 supply callback to PEM_read_bio_PrivateKey
OpenSSL 1.1.0i has changed the behaviour of their PEM APIs,
so that empty passphrases are interpreted differently. This
probabalistically breaks loading some keys, because the PEM format
is terrible and doesn't include a proper MAC.

Avoid this by providing a basic callback to avoid passing empty
passphrases to OpenSSL in cases where one is required.

Based on patch from Jakub Jelen in bz#2913; ok dtucker@
2018-10-11 10:29:29 +11:00
Damien Miller d1d301a1dd in pick_salt() avoid dereference of NULL passwords
Apparently some NIS implementations can leave pw->pw_passwd (or the
shadow equivalent) NULL.

bz#2909; based on patch from Todd Eigenschink
2018-10-10 14:57:00 +11:00
djm@openbsd.org edbb6febcc upstream: Treat all PEM_read_bio_PrivateKey() errors when a passphrase
is specified as "incorrect passphrase" instead of trying to choose between
that and "invalid format".

libcrypto can return ASN1 parsing errors rather than the expected
decrypt error in certain infrequent cases when trying to decrypt/parse
PEM private keys when supplied with an invalid passphrase.

Report and repro recipe from Thomas Deutschmann in bz#2901

ok markus@

OpenBSD-Commit-ID: b1d4cd92395f9743f81c0d23aab2524109580870
2018-10-09 16:45:45 +11:00
naddy@openbsd.org 2581333d56 upstream: Support using service names for port numbers.
* Try to resolve a port specification with getservbyname(3) if a
 numeric conversion fails.
* Make the "Port" option in ssh_config handle its argument as a
 port rather than a plain integer.

ok dtucker@ deraadt@

OpenBSD-Commit-ID: e7f03633133205ab3dfbc67f9df7475fabae660d
2018-10-07 14:58:24 +11:00
Manoj Ampalam f7ea7ca04c Pester tests updated to reflect changes in 7.8 2018-10-05 16:11:58 -07:00
Manoj Ampalam 68719a25df Ported fork to 7.8 2018-10-05 15:11:07 -07:00
Manoj Ampalam 1ce9e2005d Merge branch 'V_7_8' of https://github.com/openssh/openssh-portable into cwb 2018-10-04 14:43:51 -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
djm@openbsd.org e0d6501e86 upstream: when the peer sends a channel-close message, make sure we
close the local extended read fd (stderr) along with the regular read fd
(stdout). Avoids weird stuck processed in multiplexing mode.

Report and analysis by Nelson Elhage and Geoffrey Thomas in bz#2863

ok dtucker@ markus@

OpenBSD-Commit-ID: a48a2467fe938de4de69d2e7193d5fa701f12ae9
2018-10-04 17:50:22 +10:00
djm@openbsd.org 6f1aabb128 upstream: factor out channel status formatting from
channel_open_message() so we can use it in other debug messages

OpenBSD-Commit-ID: 9c3903ca28fcabad57f566c9d0045b41ab7d52ba
2018-10-04 17:50:22 +10:00
djm@openbsd.org f1dd179e12 upstream: include a little more information about the status and
disposition of channel's extended (stderr) fd; makes debugging some things a
bit easier. No behaviour change.

OpenBSD-Commit-ID: 483eb6467dc7d5dbca8eb109c453e7a43075f7ce
2018-10-04 10:44:49 +10:00
djm@openbsd.org 2d1428b11c upstream: explicit_bzero here to be consistent with other kex*.c;
report from coolbugcheckers AT gmail.com

OpenBSD-Commit-ID: a90f146c5b5f5b1408700395e394f70b440856cb
2018-10-04 10:42:34 +10:00