Skip to content

Commit 8c43479

Browse files
committed
Source snapshot from Powershell/openssh-portable:latestw_all
1 parent f0fd5e0 commit 8c43479

File tree

100 files changed

+2903
-1199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2903
-1199
lines changed

Makefile.in

+18-1
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ clean: regressclean
236236
rm -f regress/unittests/sshkey/test_sshkey
237237
rm -f regress/unittests/bitmap/*.o
238238
rm -f regress/unittests/bitmap/test_bitmap
239+
rm -f regress/unittests/conversion/*.o
240+
rm -f regress/unittests/conversion/test_conversion
239241
rm -f regress/unittests/hostkeys/*.o
240242
rm -f regress/unittests/hostkeys/test_hostkeys
241243
rm -f regress/unittests/kex/*.o
@@ -262,6 +264,8 @@ distclean: regressclean
262264
rm -f regress/unittests/sshkey/test_sshkey
263265
rm -f regress/unittests/bitmap/*.o
264266
rm -f regress/unittests/bitmap/test_bitmap
267+
rm -f regress/unittests/conversion/*.o
268+
rm -f regress/unittests/conversion/test_conversion
265269
rm -f regress/unittests/hostkeys/*.o
266270
rm -f regress/unittests/hostkeys/test_hostkeys
267271
rm -f regress/unittests/kex/*.o
@@ -426,6 +430,8 @@ regress-prep:
426430
mkdir -p `pwd`/regress/unittests/sshkey
427431
[ -d `pwd`/regress/unittests/bitmap ] || \
428432
mkdir -p `pwd`/regress/unittests/bitmap
433+
[ -d `pwd`/regress/unittests/conversion ] || \
434+
mkdir -p `pwd`/regress/unittests/conversion
429435
[ -d `pwd`/regress/unittests/hostkeys ] || \
430436
mkdir -p `pwd`/regress/unittests/hostkeys
431437
[ -d `pwd`/regress/unittests/kex ] || \
@@ -503,6 +509,16 @@ regress/unittests/bitmap/test_bitmap$(EXEEXT): ${UNITTESTS_TEST_BITMAP_OBJS} \
503509
regress/unittests/test_helper/libtest_helper.a \
504510
-lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
505511

512+
UNITTESTS_TEST_CONVERSION_OBJS=\
513+
regress/unittests/conversion/tests.o
514+
515+
regress/unittests/conversion/test_conversion$(EXEEXT): \
516+
${UNITTESTS_TEST_CONVERSION_OBJS} \
517+
regress/unittests/test_helper/libtest_helper.a libssh.a
518+
$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_CONVERSION_OBJS) \
519+
regress/unittests/test_helper/libtest_helper.a \
520+
-lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
521+
506522
UNITTESTS_TEST_KEX_OBJS=\
507523
regress/unittests/kex/tests.o \
508524
regress/unittests/kex/test_kex.o
@@ -558,13 +574,14 @@ regress-binaries: regress/modpipe$(EXEEXT) \
558574
regress/unittests/sshbuf/test_sshbuf$(EXEEXT) \
559575
regress/unittests/sshkey/test_sshkey$(EXEEXT) \
560576
regress/unittests/bitmap/test_bitmap$(EXEEXT) \
577+
regress/unittests/conversion/test_conversion$(EXEEXT) \
561578
regress/unittests/hostkeys/test_hostkeys$(EXEEXT) \
562579
regress/unittests/kex/test_kex$(EXEEXT) \
563580
regress/unittests/match/test_match$(EXEEXT) \
564581
regress/unittests/utf8/test_utf8$(EXEEXT) \
565582
regress/misc/kexfuzz/kexfuzz$(EXEEXT)
566583

567-
tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS)
584+
tests interop-tests t-exec unit: regress-prep regress-binaries $(TARGETS)
568585
BUILDDIR=`pwd`; \
569586
TEST_SSH_SCP="$${BUILDDIR}/scp"; \
570587
TEST_SSH_SSH="$${BUILDDIR}/ssh"; \

README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
See https://www.openssh.com/releasenotes.html#7.4p1 for the release notes.
1+
See https://www.openssh.com/releasenotes.html#7.5p1 for the release notes.
22

33
Please read https://www.openssh.com/report.html for bug reporting
44
instructions and note that we do not use Github for bug reporting or

appveyor.yml

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.0.8.0.{build}
1+
version: 0.0.10.0.{build}
22
image: Visual Studio 2015
33

44
branches:
@@ -11,12 +11,12 @@ init:
1111

1212
build_script:
1313
- ps: |
14-
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppVeyor.psm1 -DisableNameChecking
14+
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
1515
Invoke-AppVeyorBuild
1616
1717
after_build:
1818
- ps: |
19-
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppVeyor.psm1 -DisableNameChecking
19+
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
2020
Install-OpenSSH
2121
- ps: Write-Verbose "Restart computer ..."
2222
- ps: Restart-Computer -Force
@@ -25,23 +25,20 @@ after_build:
2525

2626
before_test:
2727
- ps: |
28-
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppVeyor.psm1 -DisableNameChecking
29-
Install-TestDependencies
30-
Deploy-OpenSSHTests
28+
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
29+
Setup-OpenSSHTestEnvironment -Quiet
3130
3231
test_script:
33-
- cmd: |
34-
"%ProgramFiles%\PowerShell\6.0.0.14\powershell.exe" -Command "Import-Module \"%APPVEYOR_BUILD_FOLDER%\contrib\win32\openssh\AppVeyor.psm1\" -DisableNameChecking;Run-OpenSSHPesterTest"
3532
- ps: |
36-
Check-PesterTestResult
37-
Run-OpenSSHUnitTest
33+
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
34+
Run-OpenSSHTests
3835
3936
after_test:
4037
- ps: |
41-
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppVeyor.psm1 -DisableNameChecking
38+
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
4239
Upload-OpenSSHTestResults
4340
4441
on_finish:
4542
- ps: |
46-
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppVeyor.psm1 -DisableNameChecking
43+
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
4744
Publish-Artifact

auth-passwd.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -227,15 +227,16 @@ sys_auth_passwd(Authctxt *authctxt, const char *password)
227227
#elif defined(WINDOWS)
228228
/*
229229
* Authenticate on Windows - Pass credentials to ssh-agent and retrieve token
230-
* upon succesful authentication
230+
* upon successful authentication
231+
* TODO - password is sent in plain text over IPC. Consider implications.
231232
*/
232-
extern int auth_sock;
233233
int sys_auth_passwd(Authctxt *authctxt, const char *password)
234234
{
235+
struct sshbuf *msg = NULL;
235236
size_t blen = 0;
236237
DWORD token = 0;
237-
struct sshbuf *msg = NULL;
238-
int r;
238+
extern int auth_sock;
239+
int r = 0;
239240

240241
msg = sshbuf_new();
241242
if (!msg)

auth.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir,
490490
uid_t uid, char *err, size_t errlen)
491491
{
492492
#ifdef WINDOWS
493-
error("auth_secure_path should not be called in Windows");
493+
error("auth_secure_path should not be called in Windows yet");
494494
return -1;
495495
#else /* !WINDOWS */
496496
char buf[PATH_MAX], homedir[PATH_MAX];
@@ -579,7 +579,7 @@ auth_openfile(const char *file, struct passwd *pw, int strict_modes,
579579
FILE *f;
580580

581581
#ifdef WINDOWS
582-
/* Windows POSIX adpater does not support fdopen() on open(file)*/
582+
/* Windows POSIX adapter does not support fdopen() on open(file)*/
583583
if ((f = fopen(file, "r")) == NULL) {
584584
debug("Could not open %s '%s': %s", file_type, file,
585585
strerror(errno));

auth2-pubkey.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ userauth_pubkey(Authctxt *authctxt)
178178
authenticated = 0;
179179

180180
#ifdef WINDOWS
181-
/* Pass key challenge material to ssh-agent to retrieve token upon succesful authentication */
181+
/* Pass key challenge material to ssh-agent to retrieve token upon successful authentication */
182182
{
183-
extern int auth_sock;
184-
int r;
183+
struct sshbuf *msg = NULL;
185184
u_char *blob = NULL;
186185
size_t blen = 0;
187186
DWORD token = 0;
188-
struct sshbuf *msg = NULL;
187+
extern int auth_sock;
188+
int r = 0;
189189

190190
while (1) {
191191
msg = sshbuf_new();
@@ -246,11 +246,7 @@ userauth_pubkey(Authctxt *authctxt)
246246
* if a user is not allowed to login. is this an
247247
* issue? -markus
248248
*/
249-
#ifdef WINDOWS /* key validation in done in agent for Windows */
250-
{
251-
#else /* !WINDOWS */
252249
if (PRIVSEP(user_key_allowed(authctxt->pw, key, 0))) {
253-
#endif /* !WINDOWS */
254250
packet_start(SSH2_MSG_USERAUTH_PK_OK);
255251
packet_put_string(pkalg, alen);
256252
packet_put_string(pkblob, blen);

authfd.c

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ ssh_get_authentication_socket(int *fdp)
113113
errno = oerrno;
114114
return SSH_ERR_SYSTEM_ERROR;
115115
}
116-
117116
if (fdp != NULL)
118117
*fdp = sock;
119118
else

configure.ac

+4-2
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,7 @@ AC_ARG_WITH(ldns,
14861486
else
14871487
LIBS="$LIBS `$LDNSCONFIG --libs`"
14881488
CPPFLAGS="$CPPFLAGS `$LDNSCONFIG --cflags`"
1489+
ldns=yes
14891490
fi
14901491
elif test "x$withval" != "xno" ; then
14911492
CPPFLAGS="$CPPFLAGS -I${withval}/include"
@@ -1717,6 +1718,7 @@ AC_CHECK_FUNCS([ \
17171718
inet_ntoa \
17181719
inet_ntop \
17191720
innetgr \
1721+
llabs \
17201722
login_getcapbool \
17211723
md5_crypt \
17221724
memmove \
@@ -2531,8 +2533,8 @@ if test "x$openssl" = "xyes" ; then
25312533
ssl_library_ver=`cat conftest.ssllibver`
25322534
# Check version is supported.
25332535
case "$ssl_library_ver" in
2534-
0090[[0-7]]*|009080[[0-5]]*)
2535-
AC_MSG_ERROR([OpenSSL >= 0.9.8f required (have "$ssl_library_ver")])
2536+
10000*|0*)
2537+
AC_MSG_ERROR([OpenSSL >= 1.0.1 required (have "$ssl_library_ver")])
25362538
;;
25372539
*) ;;
25382540
esac

contrib/cygwin/ssh-host-config

+9-34
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ sshd_config_configured=no
6363
port_number=22
6464
service_name=sshd
6565
strictmodes=yes
66-
privsep_used=yes
6766
cygwin_value=""
6867
user_account=
6968
password_value=
@@ -140,33 +139,21 @@ sshd_strictmodes() {
140139

141140
# ======================================================================
142141
# Routine: sshd_privsep
143-
# MODIFIES: privsep_used
142+
# Try to create ssshd user account
144143
# ======================================================================
145144
sshd_privsep() {
146145
local ret=0
147146

148147
if [ "${sshd_config_configured}" != "yes" ]
149148
then
150-
echo
151-
csih_inform "Privilege separation is set to 'sandbox' by default since"
152-
csih_inform "OpenSSH 6.1. This is unsupported by Cygwin and has to be set"
153-
csih_inform "to 'yes' or 'no'."
154-
csih_inform "However, using privilege separation requires a non-privileged account"
155-
csih_inform "called 'sshd'."
156-
csih_inform "For more info on privilege separation read /usr/share/doc/openssh/README.privsep."
157-
if csih_request "Should privilege separation be used?"
149+
if ! csih_create_unprivileged_user sshd
158150
then
159-
privsep_used=yes
160-
if ! csih_create_unprivileged_user sshd
161-
then
162-
csih_error_recoverable "Couldn't create user 'sshd'!"
163-
csih_error_recoverable "Privilege separation set to 'no' again!"
164-
csih_error_recoverable "Check your ${SYSCONFDIR}/sshd_config file!"
165-
let ++ret
166-
privsep_used=no
167-
fi
168-
else
169-
privsep_used=no
151+
csih_error_recoverable "Could not create user 'sshd'!"
152+
csih_error_recoverable "You will not be able to run an sshd service"
153+
csih_error_recoverable "under a privileged account successfully."
154+
csih_error_recoverable "Make sure to create a non-privileged user 'sshd'"
155+
csih_error_recoverable "manually before trying to run the service!"
156+
let ++ret
170157
fi
171158
fi
172159
return $ret
@@ -202,18 +189,6 @@ sshd_config_tweak() {
202189
let ++ret
203190
fi
204191
fi
205-
if [ "${sshd_config_configured}" != "yes" ]
206-
then
207-
/usr/bin/sed -i -e "
208-
s/^#\?UsePrivilegeSeparation .*/UsePrivilegeSeparation ${privsep_used}/" \
209-
${SYSCONFDIR}/sshd_config
210-
if [ $? -ne 0 ]
211-
then
212-
csih_warning "Setting privilege separation failed!"
213-
csih_warning "Check your ${SYSCONFDIR}/sshd_config file!"
214-
let ++ret
215-
fi
216-
fi
217192
return $ret
218193
} # --- End of sshd_config_tweak --- #
219194

@@ -693,7 +668,7 @@ then
693668
fi
694669
fi
695670

696-
# handle sshd_config (and privsep)
671+
# handle sshd_config
697672
csih_install_config "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults" || let ++warning_cnt
698673
if ! /usr/bin/cmp "${SYSCONFDIR}/sshd_config" "${SYSCONFDIR}/defaults/${SYSCONFDIR}/sshd_config" >/dev/null 2>&1
699674
then

contrib/redhat/openssh.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%define ver 7.4p1
1+
%define ver 7.5p1
22
%define rel 1
33

44
# OpenSSH privilege separation requires a user & group ID

contrib/suse/openssh.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation
1515
Name: openssh
16-
Version: 7.4p1
16+
Version: 7.5p1
1717
URL: https://www.openssh.com/
1818
Release: 1
1919
Source0: openssh-%{version}.tar.gz

0 commit comments

Comments
 (0)