Skip to content

Commit c156f14

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

Some content is hidden

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

41 files changed

+517
-462
lines changed

Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
8080
canohost.o channels.o cipher.o cipher-aes.o cipher-aesctr.o \
8181
cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \
8282
compat.o crc32.o deattack.o fatal.o hostfile.o \
83-
log.o match.o md-sha256.o moduli.o nchan.o packet.o opacket.o \
83+
log.o match.o moduli.o nchan.o packet.o opacket.o \
8484
readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \
8585
atomicio.o key.o dispatch.o mac.o uidswap.o uuencode.o misc.o utf8.o \
8686
monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \

appveyor.yml

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

44
branches:
@@ -18,10 +18,6 @@ after_build:
1818
- ps: |
1919
Import-Module $env:APPVEYOR_BUILD_FOLDER\contrib\win32\openssh\AppveyorHelper.psm1 -DisableNameChecking
2020
Install-OpenSSH
21-
- ps: Write-Verbose "Restart computer ..."
22-
- ps: Restart-Computer -Force
23-
- ps: Start-Sleep -s 5 # Needs to be proceeded with -ps: as it's interpreted by AppVeyor
24-
- ps: Write-Verbose "Restart computer completed!"
2521
2622
before_test:
2723
- ps: |

auth-pam.c

+9-12
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ extern char *__progname;
106106

107107
extern ServerOptions options;
108108
extern Buffer loginmsg;
109-
extern int compat20;
110109
extern u_int utmp_len;
111110

112111
/* so we don't silently change behaviour */
@@ -468,18 +467,16 @@ sshpam_thread(void *ctxtp)
468467
if (sshpam_err != PAM_SUCCESS)
469468
goto auth_fail;
470469

471-
if (compat20) {
472-
if (!do_pam_account()) {
473-
sshpam_err = PAM_ACCT_EXPIRED;
470+
if (!do_pam_account()) {
471+
sshpam_err = PAM_ACCT_EXPIRED;
472+
goto auth_fail;
473+
}
474+
if (sshpam_authctxt->force_pwchange) {
475+
sshpam_err = pam_chauthtok(sshpam_handle,
476+
PAM_CHANGE_EXPIRED_AUTHTOK);
477+
if (sshpam_err != PAM_SUCCESS)
474478
goto auth_fail;
475-
}
476-
if (sshpam_authctxt->force_pwchange) {
477-
sshpam_err = pam_chauthtok(sshpam_handle,
478-
PAM_CHANGE_EXPIRED_AUTHTOK);
479-
if (sshpam_err != PAM_SUCCESS)
480-
goto auth_fail;
481-
sshpam_password_change_required(0);
482-
}
479+
sshpam_password_change_required(0);
483480
}
484481

485482
buffer_put_cstring(&buffer, "OK");

configure.ac

+1-9
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])],
179179
CFLAGS="$saved_CFLAGS"
180180

181181
if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
182+
OSSH_CHECK_CFLAG_COMPILE([-pipe])
182183
OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments])
183184
OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option])
184185
OSSH_CHECK_CFLAG_COMPILE([-Wall])
@@ -2769,9 +2770,6 @@ if test "x$openssl" = "xyes" ; then
27692770
#include <openssl/evp.h>
27702771
#include <openssl/objects.h>
27712772
#include <openssl/opensslv.h>
2772-
#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
2773-
# error "OpenSSL < 0.9.8g has unreliable ECC code"
2774-
#endif
27752773
]], [[
27762774
EC_KEY *e = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
27772775
const EVP_MD *m = EVP_sha256(); /* We need this too */
@@ -2790,9 +2788,6 @@ if test "x$openssl" = "xyes" ; then
27902788
#include <openssl/evp.h>
27912789
#include <openssl/objects.h>
27922790
#include <openssl/opensslv.h>
2793-
#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
2794-
# error "OpenSSL < 0.9.8g has unreliable ECC code"
2795-
#endif
27962791
]], [[
27972792
EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp384r1);
27982793
const EVP_MD *m = EVP_sha384(); /* We need this too */
@@ -2811,9 +2806,6 @@ if test "x$openssl" = "xyes" ; then
28112806
#include <openssl/evp.h>
28122807
#include <openssl/objects.h>
28132808
#include <openssl/opensslv.h>
2814-
#if OPENSSL_VERSION_NUMBER < 0x0090807f /* 0.9.8g */
2815-
# error "OpenSSL < 0.9.8g has unreliable ECC code"
2816-
#endif
28172809
]], [[
28182810
EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
28192811
const EVP_MD *m = EVP_sha512(); /* We need this too */

contrib/win32/openssh/AppveyorHelper.psm1

-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ function Invoke-AppVeyorFull
8181
Set-OpenSSHTestParams
8282
Invoke-AppVeyorBuild
8383
Install-OpenSSH
84-
Install-OpenSSHTestDependencies
85-
Deploy-OpenSSHTests
8684
Setup-OpenSSHTestEnvironment
8785
Run-OpenSSHTests
8886
Publish-Artifact

contrib/win32/openssh/OpenSSHBuildHelper.psm1

+39-76
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ function Package-OpenSSH
299299
[string]$NativeHostArch = "x64",
300300

301301
[ValidateSet('Debug', 'Release', '')]
302-
[string]$Configuration = "Release"
302+
[string]$Configuration = "Release",
303+
304+
# Copy payload to DestinationPath instead of packaging
305+
[string]$DestinationPath = ""
303306
)
304307

305308
[System.IO.DirectoryInfo] $repositoryRoot = Get-RepositoryRoot
@@ -311,9 +314,8 @@ function Package-OpenSSH
311314
}
312315
$buildDir = Join-Path $repositoryRoot ("bin\" + $folderName + "\" + $Configuration)
313316
$payload = "sshd.exe", "ssh.exe", "ssh-agent.exe", "ssh-add.exe", "sftp.exe"
314-
$payload += "sftp-server.exe", "scp.exe", "ssh-lsa.dll", "ssh-shellhost.exe", "ssh-keygen.exe"
317+
$payload += "sftp-server.exe", "scp.exe", "ssh-shellhost.exe", "ssh-keygen.exe"
315318
$payload += "sshd_config", "install-sshd.ps1", "uninstall-sshd.ps1"
316-
$payload += "install-sshlsa.ps1", "uninstall-sshlsa.ps1"
317319

318320
$packageName = "OpenSSH-Win64"
319321
if ($NativeHostArch -eq 'x86') {
@@ -343,12 +345,29 @@ function Package-OpenSSH
343345
}
344346
}
345347

346-
Remove-Item ($packageDir + '.zip') -Force -ErrorAction SilentlyContinue
347-
Compress-Archive -Path $packageDir -DestinationPath ($packageDir + '.zip')
348+
if ($DestinationPath -ne "") {
349+
if (Test-Path $DestinationPath) {
350+
Remove-Item $DestinationPath\* -Force
351+
}
352+
else {
353+
New-Item -ItemType Directory $DestinationPath | Out-Null
354+
}
355+
Copy-Item -Path $packageDir\* -Destination $DestinationPath -Force -Recurse
356+
}
357+
else {
358+
Remove-Item ($packageDir + '.zip') -Force -ErrorAction SilentlyContinue
359+
Compress-Archive -Path $packageDir -DestinationPath ($packageDir + '.zip')
360+
}
348361
Remove-Item $packageDir -Recurse -Force -ErrorAction SilentlyContinue
349362

350-
Remove-Item ($symbolsDir + '.zip') -Force -ErrorAction SilentlyContinue
351-
Compress-Archive -Path $symbolsDir -DestinationPath ($symbolsDir + '.zip')
363+
364+
if ($DestinationPath -ne "") {
365+
Copy-Item -Path $symbolsDir\* -Destination $DestinationPath -Force -Recurse
366+
}
367+
else {
368+
Remove-Item ($symbolsDir + '.zip') -Force -ErrorAction SilentlyContinue
369+
Compress-Archive -Path $symbolsDir -DestinationPath ($symbolsDir + '.zip')
370+
}
352371
Remove-Item $symbolsDir -Recurse -Force -ErrorAction SilentlyContinue
353372
}
354373

@@ -436,97 +455,41 @@ function Get-SolutionFile
436455

437456
<#
438457
.Synopsis
439-
Deploy all required files to build a package and create zip file.
458+
Deploy all required files to a location and install the binaries
440459
#>
441-
function Deploy-Win32OpenSSHBinaries
460+
function Install-OpenSSH
442461
{
443462
[CmdletBinding()]
444463
param
445-
(
464+
(
446465
[ValidateSet('Debug', 'Release', '')]
447466
[string]$Configuration = "",
467+
448468
[ValidateSet('x86', 'x64', '')]
449469
[string]$NativeHostArch = "",
470+
450471
[string]$OpenSSHDir = "$env:SystemDrive\OpenSSH"
451472
)
452473

453-
if (-not (Test-Path -Path $OpenSSHDir -PathType Container))
474+
if ($Configuration -eq "")
454475
{
455-
$null = New-Item -Path $OpenSSHDir -ItemType Directory -Force -ErrorAction Stop
476+
$Configuration = 'Release'
456477
}
457478

458-
[string] $platform = $env:PROCESSOR_ARCHITECTURE
459-
if(-not [String]::IsNullOrEmpty($NativeHostArch))
479+
if ($NativeHostArch -eq "")
460480
{
461-
$folderName = $NativeHostArch
462-
if($NativeHostArch -ieq 'x86')
463-
{
464-
$folderName = "Win32"
465-
}
466-
}
467-
else
468-
{
469-
if($platform -ieq "AMD64")
470-
{
471-
$folderName = "x64"
472-
}
473-
else
474-
{
475-
$folderName = "Win32"
476-
}
477-
}
478-
479-
if([String]::IsNullOrEmpty($Configuration))
480-
{
481-
if( $folderName -ieq "Win32" )
482-
{
483-
$RealConfiguration = "Debug"
484-
}
485-
else
486-
{
487-
$RealConfiguration = "Release"
481+
$NativeHostArch = 'x64'
482+
if ($env:PROCESSOR_ARCHITECTURE -eq 'x86') {
483+
$NativeHostArch = 'x86'
488484
}
489485
}
490-
else
491-
{
492-
$RealConfiguration = $Configuration
493-
}
494486

495-
[System.IO.DirectoryInfo] $repositoryRoot = Get-RepositoryRoot
496-
497-
$sourceDir = Join-Path $repositoryRoot.FullName -ChildPath "bin\$folderName\$RealConfiguration"
498-
if((Get-Service ssh-agent -ErrorAction Ignore) -ne $null) {
499-
Stop-Service ssh-agent -Force
500-
}
501-
Copy-Item -Path "$sourceDir\*" -Destination $OpenSSHDir -Include *.exe,*.dll -Exclude *unittest*.* -Force -ErrorAction Stop
502-
$sourceDir = Join-Path $repositoryRoot.FullName -ChildPath "contrib\win32\openssh"
503-
Copy-Item -Path "$sourceDir\*" -Destination $OpenSSHDir -Include *.ps1,sshd_config -Exclude AnalyzeCodeDiff.ps1 -Force -ErrorAction Stop
504-
}
505-
506-
<#
507-
.Synopsis
508-
Deploy all required files to a location and install the binaries
509-
#>
510-
function Install-OpenSSH
511-
{
512-
[CmdletBinding()]
513-
param
514-
(
515-
[ValidateSet('Debug', 'Release', '')]
516-
[string]$Configuration = "",
517-
518-
[ValidateSet('x86', 'x64', '')]
519-
[string]$NativeHostArch = "",
520-
521-
[string]$OpenSSHDir = "$env:SystemDrive\OpenSSH"
522-
)
523-
524-
Deploy-Win32OpenSSHBinaries @PSBoundParameters
487+
Package-OpenSSH -NativeHostArch $NativeHostArch -Configuration $Configuration -DestinationPath $OpenSSHDir
525488

526489
Push-Location $OpenSSHDir
527490
& ( "$OpenSSHDir\install-sshd.ps1")
528491
.\ssh-keygen.exe -A
529-
& ( "$OpenSSHDir\install-sshlsa.ps1")
492+
530493

531494
#machine will be reboot after Install-openssh anyway
532495
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'MACHINE')

contrib/win32/openssh/Win32-OpenSSH.sln

-14
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sshd", "sshd.vcxproj", "{F5
5555
EndProject
5656
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "config", "config.vcxproj", "{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}"
5757
EndProject
58-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh-lsa", "ssh-lsa.vcxproj", "{02FB3D98-6516-42C6-9762-98811A99960F}"
59-
ProjectSection(ProjectDependencies) = postProject
60-
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}
61-
EndProjectSection
62-
EndProject
6358
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "posix_compat", "win32iocompat.vcxproj", "{0D02F0F0-013B-4EE3-906D-86517F3822C0}"
6459
ProjectSection(ProjectDependencies) = postProject
6560
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}
@@ -226,14 +221,6 @@ Global
226221
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}.Release|x64.Build.0 = Release|x64
227222
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}.Release|x86.ActiveCfg = Release|Win32
228223
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}.Release|x86.Build.0 = Release|Win32
229-
{02FB3D98-6516-42C6-9762-98811A99960F}.Debug|x64.ActiveCfg = Debug|x64
230-
{02FB3D98-6516-42C6-9762-98811A99960F}.Debug|x64.Build.0 = Debug|x64
231-
{02FB3D98-6516-42C6-9762-98811A99960F}.Debug|x86.ActiveCfg = Debug|Win32
232-
{02FB3D98-6516-42C6-9762-98811A99960F}.Debug|x86.Build.0 = Debug|Win32
233-
{02FB3D98-6516-42C6-9762-98811A99960F}.Release|x64.ActiveCfg = Release|x64
234-
{02FB3D98-6516-42C6-9762-98811A99960F}.Release|x64.Build.0 = Release|x64
235-
{02FB3D98-6516-42C6-9762-98811A99960F}.Release|x86.ActiveCfg = Release|Win32
236-
{02FB3D98-6516-42C6-9762-98811A99960F}.Release|x86.Build.0 = Release|Win32
237224
{0D02F0F0-013B-4EE3-906D-86517F3822C0}.Debug|x64.ActiveCfg = Debug|x64
238225
{0D02F0F0-013B-4EE3-906D-86517F3822C0}.Debug|x64.Build.0 = Debug|x64
239226
{0D02F0F0-013B-4EE3-906D-86517F3822C0}.Debug|x86.ActiveCfg = Debug|Win32
@@ -343,7 +330,6 @@ Global
343330
{6657614F-7821-4D55-96EF-7C3C4B551880} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}
344331
{F58FF6BA-098B-4DB9-9609-A030DFB4D03F} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}
345332
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}
346-
{02FB3D98-6516-42C6-9762-98811A99960F} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}
347333
{0D02F0F0-013B-4EE3-906D-86517F3822C0} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}
348334
{C0AE8A30-E4FA-49CE-A2B5-0C072C77EC64} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}
349335
{F6644EC5-D6B6-42A1-828C-75E2977470E0} = {17322AAF-808F-4646-AD37-5B0EDDCB8F3E}

contrib/win32/openssh/config.h.vs

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297

298298
/* Define to 1 if you have the declaration of `O_NONBLOCK', and to 0 if you
299299
don't. */
300-
#define HAVE_DECL_O_NONBLOCK 0
300+
#define HAVE_DECL_O_NONBLOCK 1
301301

302302
/* Define to 1 if you have the declaration of `passwdexpired', and to 0 if you
303303
don't. */

contrib/win32/openssh/keygen.vcxproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="paths.targets" />
44
<ItemGroup Label="ProjectConfigurations">
@@ -186,11 +186,12 @@
186186
<ItemGroup>
187187
<ClCompile Include="$(OpenSSH-Src-Path)ssh-keygen.c" />
188188
<ClCompile Include="$(OpenSSH-Src-Path)contrib\win32\win32compat\wmain_common.c" />
189+
<ClCompile Include="$(OpenSSH-Src-Path)contrib\win32\win32compat\win32-utf8.c" />
189190
</ItemGroup>
190191
<ItemGroup>
191192
<ResourceCompile Include="version.rc" />
192193
</ItemGroup>
193194
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
194195
<ImportGroup Label="ExtensionTargets">
195196
</ImportGroup>
196-
</Project>
197+
</Project>

contrib/win32/openssh/keygen.vcxproj.filters

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
44
<Filter Include="Source Files">
@@ -21,10 +21,13 @@
2121
<ClCompile Include="$(OpenSSH-Src-Path)contrib\win32\win32compat\wmain_common.c">
2222
<Filter>Source Files</Filter>
2323
</ClCompile>
24+
<ClCompile Include="$(OpenSSH-Src-Path)contrib\win32\win32compat\win32-utf8.c">
25+
<Filter>Source Files</Filter>
26+
</ClCompile>
2427
</ItemGroup>
2528
<ItemGroup>
2629
<ResourceCompile Include="version.rc">
2730
<Filter>Resource Files</Filter>
2831
</ResourceCompile>
2932
</ItemGroup>
30-
</Project>
33+
</Project>

contrib/win32/openssh/libssh.vcxproj

-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@
240240
<ClCompile Include="$(OpenSSH-Src-Path)log.c" />
241241
<ClCompile Include="$(OpenSSH-Src-Path)mac.c" />
242242
<ClCompile Include="$(OpenSSH-Src-Path)match.c" />
243-
<ClCompile Include="$(OpenSSH-Src-Path)md-sha256.c" />
244243
<ClCompile Include="$(OpenSSH-Src-Path)misc.c" />
245244
<ClCompile Include="$(OpenSSH-Src-Path)moduli.c" />
246245
<ClCompile Include="$(OpenSSH-Src-Path)monitor_fdpass.c" />

contrib/win32/openssh/libssh.vcxproj.filters

-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@
177177
<ClCompile Include="$(OpenSSH-Src-Path)match.c">
178178
<Filter>Source Files</Filter>
179179
</ClCompile>
180-
<ClCompile Include="$(OpenSSH-Src-Path)md-sha256.c">
181-
<Filter>Source Files</Filter>
182-
</ClCompile>
183180
<ClCompile Include="$(OpenSSH-Src-Path)misc.c">
184181
<Filter>Source Files</Filter>
185182
</ClCompile>

0 commit comments

Comments
 (0)