[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 10/63: tests: add support to test against OpenSSH f
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 10/63: tests: add support to test against OpenSSH for Windows |
Date: |
Fri, 07 Jun 2019 18:36:32 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 081d374f4949b7fabfa76a0fb14daa02d47b5050
Author: Marc Hoersken <address@hidden>
AuthorDate: Mon Nov 19 21:05:57 2018 +0100
tests: add support to test against OpenSSH for Windows
Testing against OpenSSH for Windows requires v7.7.0.0 or newer
due to the use of AllowUsers and DenyUsers. For more info see:
https://github.com/PowerShell/Win32-OpenSSH/wiki/sshd_config
---
tests/sshhelp.pm | 10 ++++++++++
tests/sshserver.pl | 46 ++++++++++++++++++++++++++++++++++++++++------
2 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/tests/sshhelp.pm b/tests/sshhelp.pm
index 7345eb300..47ea2324c 100644
--- a/tests/sshhelp.pm
+++ b/tests/sshhelp.pm
@@ -430,6 +430,16 @@ sub sshversioninfo {
$error = undef;
last;
}
+ if($tmpstr =~
/OpenSSH[_-]for[_-]Windows[_-](\d+)\.(\d+)(\.(\d+))*/i) {
+ $major = $1;
+ $minor = $2;
+ $patch = $4?$4:0;
+ $sshid = 'OpenSSH-Windows';
+ $versnum = (100*$major) + (10*$minor) + $patch;
+ $versstr = "$sshid $major.$minor.$patch";
+ $error = undef;
+ last;
+ }
if($tmpstr =~ /Sun[_-]SSH[_-](\d+)\.(\d+)(\.(\d+))*/i) {
$major = $1;
$minor = $2;
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
old mode 100755
new mode 100644
index 428535ece..bcb2f1b3a
--- a/tests/sshserver.pl
+++ b/tests/sshserver.pl
@@ -389,6 +389,17 @@ if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys') {
$pidfile_config = pathhelp::build_sys_abs_path($pidfile_config);
$sftpsrv_config = "internal-sftp";
}
+if ($sshdid =~ /OpenSSH-Windows/) {
+ # Ensure to use native Windows paths with OpenSSH for Windows
+ $clipubkeyf_config = pathhelp::sys_native_abs_path($clipubkeyf);
+ $hstprvkeyf_config = pathhelp::sys_native_abs_path($hstprvkeyf);
+ $pidfile_config = pathhelp::sys_native_abs_path($pidfile);
+ $sftpsrv_config = pathhelp::sys_native_abs_path($sftpsrv);
+
+ $sshdconfig = pathhelp::sys_native_abs_path($sshdconfig);
+ $sshconfig = pathhelp::sys_native_abs_path($sshconfig);
+ $sftpconfig = pathhelp::sys_native_abs_path($sftpconfig);
+}
#***************************************************************************
# ssh daemon configuration file options we might use and version support
@@ -483,8 +494,18 @@ logmsg 'generating ssh server config file...' if($verbose);
push @cfgarr, '# This is a generated file. Do not edit.';
push @cfgarr, "# $sshdverstr sshd configuration file for curl testing";
push @cfgarr, '#';
-push @cfgarr, "DenyUsers !$username";
-push @cfgarr, "AllowUsers $username";
+
+# AllowUsers and DenyUsers options should use lowercase on Windows
+# and do not support quotes around values for some unknown reason.
+if ($sshdid =~ /OpenSSH-Windows/) {
+ my $username_lc = lc $username;
+ push @cfgarr, "DenyUsers !$username_lc";
+ push @cfgarr, "AllowUsers $username_lc";
+} else {
+ push @cfgarr, "DenyUsers !$username";
+ push @cfgarr, "AllowUsers $username";
+}
+
push @cfgarr, 'DenyGroups';
push @cfgarr, 'AllowGroups';
push @cfgarr, '#';
@@ -758,7 +779,11 @@ if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys') {
$identity_config = pathhelp::build_sys_abs_path($identity_config);
$knownhosts_config = pathhelp::build_sys_abs_path($knownhosts_config);
}
-
+if ($sshdid =~ /OpenSSH-Windows/) {
+ # Ensure to use native Windows paths with OpenSSH for Windows
+ $identity_config = pathhelp::sys_native_abs_path($identity);
+ $knownhosts_config = pathhelp::sys_native_abs_path($knownhosts);
+}
#***************************************************************************
# ssh client configuration file options we might use and version support
@@ -853,7 +878,12 @@ push @cfgarr, "HostName $listenaddr";
push @cfgarr, "User $username";
push @cfgarr, 'Protocol 2';
push @cfgarr, '#';
-push @cfgarr, "BindAddress $listenaddr";
+
+# BindAddress option is not supported by OpenSSH for Windows
+if (!($sshdid =~ /OpenSSH-Windows/)) {
+ push @cfgarr, "BindAddress $listenaddr";
+}
+
push @cfgarr, '#';
push @cfgarr, "IdentityFile $identity_config";
push @cfgarr, "UserKnownHostsFile $knownhosts_config";
@@ -875,8 +905,12 @@ push @cfgarr, 'NumberOfPasswordPrompts 0';
push @cfgarr, 'PasswordAuthentication no';
push @cfgarr, 'PreferredAuthentications publickey';
push @cfgarr, 'PubkeyAuthentication yes';
-push @cfgarr, 'RhostsRSAAuthentication no';
-push @cfgarr, 'RSAAuthentication no';
+
+# RSA authentication options are not supported by OpenSSH for Windows
+if (!($sshdid =~ /OpenSSH-Windows/)) {
+ push @cfgarr, 'RhostsRSAAuthentication no';
+ push @cfgarr, 'RSAAuthentication no';
+}
# Disabled StrictHostKeyChecking since it makes the tests fail on my
# OpenSSH_6.0p1 on Debian Linux / Daniel
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] branch master updated (7959939f1 -> 5d5e1c738), gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 03/63: PolarSSL: deprecate support step 1. Removed from configure., gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 01/63: parse_proxy: use the IPv6 zone id if given, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 04/63: http2-download: fix format specifier, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 05/63: examples: reduce variable scopes, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 11/63: sasl: Implement SASL authorisation identity via CURLOPT_SASL_AUTHZID, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 10/63: tests: add support to test against OpenSSH for Windows,
gnunet <=
- [GNUnet-SVN] [gnurl] 08/63: examples: fix "clarify calculation precedence" warnings, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 02/63: configure/cmake: check for if_nametoindex(), gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 13/63: examples: Added SASL PLAIN authorisation identity (authzid) examples, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 09/63: bump: start on the next release, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 15/63: url: fix bad #ifdef, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 14/63: Revert "progress: CURL_DISABLE_PROGRESS_METER", gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 23/63: winbuild: Use two space indentation, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 17/63: config-win32: add support for if_nametoindex and getsockname, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 22/63: tool_parse_cfg: Avoid 2 fopen() for WIN32, gnunet, 2019/06/07
- [GNUnet-SVN] [gnurl] 39/63: parse_proxy: make sure portptr is initialized, gnunet, 2019/06/07