12665 Commits

Author SHA1 Message Date
djm@openbsd.org
74b77f7497
upstream: sftp-server(8): add a "users-groups-by-id@openssh.com"
extension request that allows the client to obtain user/group names that
correspond to a set of uids/gids.

Will be used to make directory listings more useful and consistent
in sftp(1).

ok markus@

OpenBSD-Commit-ID: 7ebabde0bcb95ef949c4840fe89e697e30df47d3
2022-09-19 20:49:13 +10:00
djm@openbsd.org
231a346c0c
upstream: better debugging for connect_next()
OpenBSD-Commit-ID: d16a307a0711499c971807f324484ed3a6036640
2022-09-19 19:25:14 +10:00
djm@openbsd.org
1875042c52
upstream: Add RequiredRSASize for sshd(8); RSA keys that fall
beneath this limit will be ignored for user and host-based authentication.

Feedback deraadt@ ok markus@

OpenBSD-Commit-ID: 187931dfc19d51873df5930a04f2d972adf1f7f1
2022-09-17 20:39:02 +10:00
djm@openbsd.org
54b333d12e
upstream: add a RequiredRSASize for checking RSA key length in
ssh(1). User authentication keys that fall beneath this limit will be
ignored. If a host presents a host key beneath this limit then the connection
will be terminated (unfortunately there are no fallbacks in the protocol for
host authentication).

feedback deraadt, Dmitry Belyavskiy; ok markus@

OpenBSD-Commit-ID: 430e339b2a79fa9ecc63f2837b06fdd88a7da13a
2022-09-17 20:39:02 +10:00
djm@openbsd.org
07d8771bac
upstream: Add a sshkey_check_rsa_length() call for checking the
length of an RSA key; ok markus@

OpenBSD-Commit-ID: de77cd5b11594297eda82edc594b0d32b8535134
2022-09-17 20:38:40 +10:00
djm@openbsd.org
3991a0cf94
upstream: actually hook up restrict_websafe; the command-line flag
was never actually used. Spotted by Matthew Garrett

OpenBSD-Commit-ID: 0b363518ac4c2819dbaa3dfad4028633ab9cdff1
2022-09-17 20:37:20 +10:00
djm@openbsd.org
30b2a7e429
upstream: correct error value
OpenBSD-Commit-ID: 780efcbad76281f11f14b2a5ff04eb6db3dfdad4
2022-09-17 20:37:19 +10:00
djm@openbsd.org
ac1ec95459
upstream: sftp: Be a bit more clever about completions
There are commands (e.g. "get" or "put") that accept two
arguments, a local path and a remote path. However, the way
current completion is written doesn't take this distinction into
account and always completes remote or local paths.

By expanding CMD struct and "cmds" array this distinction can be
reflected and with small adjustment to completer code the correct
path can be completed.

By Michal Privoznik, ok dtucker@

OpenBSD-Commit-ID: 1396d921c4eb1befd531f5c4a8ab47e7a74b610b
2022-09-16 13:35:22 +10:00
djm@openbsd.org
590db83384
upstream: sftp: Don't attempt to complete arguments for
non-existent commands

If user entered a non-existent command (e.g. because they made a
typo) there is no point in trying to complete its arguments. Skip
calling complete_match() if that's the case.

From Michal Privoznik

OpenBSD-Commit-ID: cf39c811a68cde2aeb98fc85addea4000ef6b07a
2022-09-16 13:35:21 +10:00
Tess Gauthier
b006c8d8f4 define HAVE_KILLPG 2022-09-14 17:30:12 -04:00
djm@openbsd.org
ff9809fdfd
upstream: sk_enroll: never drop SSH_SK_USER_VERIFICATION_REQD flag
from response

Now that all FIDO signing calls attempt first without PIN and then
fall back to trying PIN only if that attempt fails, we can remove the
hack^wtrick that removed the UV flag from the keys returned during
enroll.

By Corinna Vinschen

OpenBSD-Commit-ID: 684517608c8491503bf80cd175425f0178d91d7f
2022-09-14 10:16:06 +10:00
djm@openbsd.org
940dc10729
upstream: a little extra debugging
OpenBSD-Commit-ID: edf1601c1d0905f6da4c713f4d9cecc7d1c0295a
2022-09-14 10:16:05 +10:00
djm@openbsd.org
4b5f91cb95
upstream: ssh-agent: attempt FIDO key signing without PIN and use
the error to determine whether a PIN is required and prompt only if
necessary. from Corinna Vinschen

OpenBSD-Commit-ID: dd6be6a0b7148608e834ee737c3479b3270b00dd
2022-09-14 10:16:05 +10:00
jmc@openbsd.org
113523bf0b
upstream: .Li -> .Vt where appropriate; from josiah frentsos,
tweaked by schwarze

ok schwarze

OpenBSD-Commit-ID: 565046e3ce68b46c2f440a93d67c2a92726de8ed
2022-09-14 10:16:04 +10:00
jsg@openbsd.org
86af013b56
upstream: fix repeated words ok miod@ jmc@
OpenBSD-Commit-ID: 6765daefe26a6b648cc15cadbbe337596af709b7
2022-09-14 10:16:04 +10:00
Tess Gauthier
f4d2ff0409 fix pester test failures 2022-09-13 17:50:40 -04:00
Tess Gauthier
215341dd66 openssh-9.0
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEcWi5g4FaXu9ZpK39Kj9BTnNgYLoFAmJObaQACgkQKj9BTnNg
 YLo8sxAAgLZEtkkgM3m5IXRDbwq95Z1zD87vcxv6IixeLqCKpXwNOARInfPcR0vJ
 gWY5HGUyB3FKxqjdKkQNjZLCofwKJGVo8hXYky+vTrD9brUYOJ2fJSpWddfNCTZF
 66EHblpGbMXRbBVX3mocXAWErjGsklEemGsIqbCXZCay6AuFW7qCl0b+K5LELNuX
 LvfTCjwPBXQSndzIspHdQkkfQruGfSopLVm/XqfR5RvtBfGhr602sj+m0XN50/ZW
 ICDK82y9wXBCCIXpflUOuYi7pwhqhHZWTNVHiMLklGpWF8VEaU7PkKxiy2bbKSxU
 5SllG/+DticIAIY/gykYzLg3tcz3m5V1cWxO52fXG8ZmuWyX/iL0hk5REJg3jb+q
 EHGmL2ML+nqJsGDYuQYeUCYbw/IO1W8nNXBNcfdadC+fU/HfapYFoyK4mh4/bqcv
 TjRObmz3L2CQO01cK4+CF8Od/8evt7/zOVjCd6LSjtVfjK34lEKwUQsaSv/C46MJ
 dHB1N0f5tElEjt1IIXtj1YGRxkYey42NCKvLBSYNMFhsD0OUCd7ZzC16QYt5nEx6
 du7//ED1Dc6gACEmkkLCOKGnB2lMzegdNbsZOsoJ8Dw+xsy/1Up1tLBbaA8nJss9
 Vz9z3ymjcB3YSSNSeCAJxjJUC41AMvAEqDJl6ChJyAvKMto22j8=
 =+gmq
 -----END PGP SIGNATURE-----

resolve merge conflicts
2022-09-09 12:30:06 -04:00
djm@openbsd.org
0ba39b93b3
upstream: notifier_complete(NULL, ...) is a noop, so no need to test
that ctx!=NULL; from Corinna Vinschen

OpenBSD-Commit-ID: ade2f2e9cc519d01a586800c25621d910bce384a
2022-09-09 13:38:14 +10:00
Tess Gauthier
24c095e785
add motw to scp and sftp (#614)
* add motw to scp and sftp

* retrigger appveyor

* fix motw for filepaths with unicode characters

* modify error handling

* add debug for appveyor

* modify motw method to use openssh method to open filestream

* fix return value for null fileStreamPath pointer

* fix spacing, comments, and failure message

* clean up mark of the web method

* incorporate MapUrlToZone for sftp & partially scp

* update scp for motw failure case

* Update contrib/win32/win32compat/misc.c

Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>

* address pr review comments

* refactor failure handling in motw methods

* add CoUnitialize after CoInitializeEx call

* use urlmon.h constants for com instance

* update var name for consistency

Co-authored-by: Paul Higinbotham <paulhi@microsoft.com>
2022-09-08 11:55:10 -04:00
Sam James
be19763532
openbsd-compat/bsd-asprintf: add <stdio.h> include for vsnprintf
Fixes the following build failure with Clang 15 on musl:
```
bsd-asprintf.c:51:8: error: call to undeclared library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, struct __va_list_tag *)'; ISO C99 and laterclang -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -pipe -Wunknown-warning-option -Qunused-arguments -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wmisleading-indentation -Wbitwise-instead-of-logical -fno-strict-aliasing -mretpoline  -ftrapv -fzero-call-used-regs=all -fno-builtin-memset -fstack-protector-strong -fPIE   -I. -I.  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DSSHDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/usr/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/lib/misc/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/lib/misc/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/lib/misc/ssh-keysign\" -D_PATH_SSH_PKCS11_HELPER=\"/usr/lib/misc/ssh-pkcs11-helper\" -D_PATH_SSH_SK_HELPER=\"/usr/lib/misc/ssh-sk-helper\" -D_PATH_SSH_PIDDIR=\"/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c cipher-aes.c -o cipher-aes.o
 do not support
      implicit function declarations [-Wimplicit-function-declaration]
        ret = vsnprintf(string, INIT_SZ, fmt, ap2);
              ^
bsd-asprintf.c:51:8: note: include the header <stdio.h> or explicitly provide a declaration for 'vsnprintf'
1 error generated.
```
2022-09-08 12:04:00 +10:00
Darren Tucker
6cb6f660bb
Remove DEF_WEAK, it's already in defines.h. 2022-09-02 16:43:27 +10:00
Darren Tucker
ce39e7d8b7
Resync arc4random with OpenBSD.
This brings us up to current, including djm's random-reseeding change,
as prompted by logan at cyberstorm.mu in bz#3467.  It brings the
platform-specific hooks from LibreSSL Portable, simplified to match our
use case.  ok djm@.
2022-09-02 14:30:38 +10:00
Darren Tucker
beaddde26f
Move OPENBSD ORIGINAL marker.
Putting this after the copyright statement (which doesn't change)
instead of before the version identifier (which does) prevents merge
conflicts when resyncing changes.
2022-09-02 14:30:38 +10:00
Darren Tucker
c83e467ead
Remove arc4random_uniform from arc4random.c
This was previously moved into its own file (matching OpenBSD) which
prematurely committed in commit 73541f2.
2022-09-02 14:30:38 +10:00
djm@openbsd.org
5f45c2395c
upstream: sk-usbhid: fix key_lookup() on tokens with built-in UV
explicitly test whether the token performs built-in UV (e.g. biometric
tokens) and enable UV in that case. From Pedro Martelletto via GHPR#388

OpenBSD-Commit-ID: 007eb7e387d27cf3029ab06b88224e03eca62ccd
2022-09-02 14:21:06 +10:00
Darren Tucker
03277a4aa4
Move sftp from valgrind-2 to 3 to rebalance. 2022-08-31 20:26:30 +10:00
djm@openbsd.org
fcf5365da6
upstream: whitespace
OpenBSD-Commit-ID: c2bcbf93610d3d62ed206cdf9bf9ff98c6aaf232
2022-08-31 12:57:42 +10:00
Damien Miller
e60136a3d7
additional keys 2022-08-29 13:27:45 +10:00
Damien Miller
2b02dcb505
cross-sign allowed_signers with PGP key
Provides continuity of trust from legacy PGP release key to
the SSHSIG signing keys that we will use henceforth for git
signing.
2022-08-29 13:23:43 +10:00
ago-shi
58dd2dff82 Fix not to assign null to strstr function 2022-08-28 12:01:46 +09:00
Darren Tucker
51b345f177
Add libcrypt-devel to cygwin-release deps.
Based on feedback from vinschen at redhat.com.
2022-08-27 21:49:27 +10:00
Darren Tucker
9f81736cf1
Add Windows 2022 test targets. 2022-08-27 09:37:40 +10:00
Darren Tucker
85e1a69243
Add cygwin-release test target.
This also moves the cygwin package install from the workflow file to
setup_ci.sh so that we can install different sets of Cygwin packages
for different test configs.
2022-08-26 19:22:25 +10:00
djm@openbsd.org
92382dbe8b
upstream: whitespace
OpenBSD-Commit-ID: a5d015efbfd228dc598ffdef612d2da3a579e5d8
2022-08-26 18:17:57 +10:00
djm@openbsd.org
70a5de0a50
upstream: whitespace
OpenBSD-Commit-ID: d297e4387935d4aef091c5e9432578c2e513f538
2022-08-26 18:14:02 +10:00
Damien Miller
3a683a19fd
initial list of allowed signers 2022-08-26 14:23:55 +10:00
ago-shi
da0b80c46f Fix not to assign null to strstr function 2022-08-22 00:09:00 +09:00
Darren Tucker
6851f4b8c3 Install Cygwin packages based on OS not config. 2022-08-19 17:22:18 +10:00
djm@openbsd.org
f964809068 upstream: attemp FIDO key signing without PIN and use the error
code returned to fall back only if necessary. Avoids PIN prompts for FIDO
tokens that don't require them; part of GHPR#302

OpenBSD-Commit-ID: 4f752aaf9f2e7c28bcaaf3d4f8fc290131bd038e
2022-08-19 16:34:06 +10:00
djm@openbsd.org
5453333b5d upstream: remove incorrect check that can break enrolling a
resident key (introduced in r1.40)

OpenBSD-Commit-ID: 4cab364d518470e29e624af3d3f9ffa9c92b6f01
2022-08-19 16:34:06 +10:00
dtucker@openbsd.org
ff89b1bed8 upstream: Strictly enforce the maximum allowed SSH2 banner size in
ssh-keyscan and prevent a one-byte buffer overflow.  Patch from Qualys, ok
djm@

OpenBSD-Commit-ID: 6ae664f9f4db6e8a0589425f74cd0bbf3aeef4e4
2022-08-19 16:34:06 +10:00
Darren Tucker
1b470b9036 Fix cygwin conditional steps. 2022-08-19 15:19:19 +10:00
Darren Tucker
fd6ee741ab Add a bit more debug output. 2022-08-19 15:12:57 +10:00
Darren Tucker
a9305c4c73 Add Cygwin (on windows-2019) test target.
In addition to installing the requisite Cygwin packages, we also need to
explicitly invoke "sh" for steps that run other scripts since the runner
environment doesn't understand #! paths.
2022-08-19 15:08:57 +10:00
djm@openbsd.org
5062ad4881 upstream: double free() in error path; from Eusgor via GHPR333
OpenBSD-Commit-ID: 39f35e16ba878c8d02b4d01d8826d9b321be26d4
2022-08-19 13:13:53 +10:00
Darren Tucker
5a5c580b48 Check for perms to run agent-getpeereid test.
Ubuntu 22.04 defaults to private home dirs which prevents "nobody"
running ssh-add during the agent-getpeereid test.  Check for this and
add the necessary permissions.
2022-08-18 21:36:39 +10:00
Damien Miller
cd06a76b7c on Cygwin, prefer WinHello FIDO device
If no FIDO device was explictly specified, then prefer the
windows://hello FIDO device. An exception to this is when
probing resident FIDO keys, in which case hardware FIDO
devices are preferred.
2022-08-17 16:04:16 +10:00
djm@openbsd.org
47f72f534a upstream: add an extra flag to sk_probe() to indicate whether we're
probing for a FIDO resident key or not. Unused here, but will make like
easier for portable

OpenBSD-Commit-ID: 432c8ff70e270378df9dbceb9bdeaa5b43b5a832
2022-08-17 16:03:01 +10:00
jmc@openbsd.org
edb0bcb3c7 upstream: use .Cm for "sign"; from josiah frentsos
OpenBSD-Commit-ID: 7f80a53d54857ac6ae49ea6ad93c5bd12231d1e4
2022-08-17 16:03:01 +10:00
Corinna Vinschen
cccb011e13 Revert "check_sk_options: add temporary WinHello workaround"
Cygwin now comes with libfido2 1.11.0, so this workaround
isn't required anymore.

This reverts commit 242c044ab111a37aad3b0775727c36a4c5f0102c.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2022-08-12 15:34:47 +10:00