diff --git a/.azure/checkout.yml b/.azure/checkout.yml new file mode 100644 index 00000000000..e9cdfa7c2d1 --- /dev/null +++ b/.azure/checkout.yml @@ -0,0 +1,34 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +steps: +- script: git config --global core.autocrlf false + displayName: 'Fix Checkout' + name: fixCheckout + +- checkout: self + clean: false + fetchDepth: 5 + path: JtR + +# For a fast build run, uncomment #### +# - script: | +# cd $(Build.SourcesDirectory)\src +# del *plug.c +# ###################################### diff --git a/.azure/linux-build-and-test-steps.yml b/.azure/linux-build-and-test-steps.yml new file mode 100644 index 00000000000..9307a3aaa8e --- /dev/null +++ b/.azure/linux-build-and-test-steps.yml @@ -0,0 +1,27 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + steps: + - bash: | + .ci/tests-ci.sh $TARGET_ARCH BUILD + displayName: 'Building JtR' + + - bash: | + .ci/tests-ci.sh $TARGET_ARCH TEST + displayName: 'Testing JtR' diff --git a/.azure/linux-ci.yml b/.azure/linux-ci.yml new file mode 100644 index 00000000000..f9943280ec3 --- /dev/null +++ b/.azure/linux-ci.yml @@ -0,0 +1,22 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + steps: + - template: linux-system-info.yml + - template: linux-build-and-test-steps.yml diff --git a/.azure/linux-system-info.yml b/.azure/linux-system-info.yml new file mode 100644 index 00000000000..2f900ecfb58 --- /dev/null +++ b/.azure/linux-system-info.yml @@ -0,0 +1,25 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + steps: + - script: | + wget https://raw.githubusercontent.com/openwall/john-packages/release/scripts/show_info.sh -O show_info.sh + chmod a+x show_info.sh + ./show_info.sh + displayName: 'System Information' diff --git a/.azure/windows-build-and-test-steps.yml b/.azure/windows-build-and-test-steps.yml new file mode 100644 index 00000000000..e18441daf36 --- /dev/null +++ b/.azure/windows-build-and-test-steps.yml @@ -0,0 +1,134 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +steps: + - powershell: | + # Setup image environment ############################################## + $cygwinFolder = "C:\$env:cygwinPath" + + cd $env:BUILD_FOLDER + git describe --dirty=+ --always + echo '--------------------------------' + + # Windows 2012 does not have Chocolatey installed + if ($env:SYSTEM_PHASENAME -eq "Windows_2012") { + Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + choco install -y 7zip.install + } + + # If needed (CygWin is not installed) or as a workaround (CygWin update is required) + if ($env:Cygwin -eq "install") { + choco install -y cygwin cyg-get + cyg-get libssl-devel libbz2-devel libgmp-devel zlib-devel gcc-core libOpenCL-devel libcrypt-devel make wget rebase perl + } + + # Powershell shell "Bash" run ########################################## + $posixBuildFolder = $env:BUILD_FOLDER -Replace '\\', '/' + + function shell($command, $dieOnError = $true) { + + Write-Host "Executing '$command'" + & "$cygwinFolder\bash" -lc ". /etc/profile && cd $posixBuildFolder && $command" + + if ($LASTEXITCODE -ne 0) { + Write-Host "'$command' failed with exit code $LASTEXITCODE! " -ForegroundColor Red -NoNewline + + if ($dieOnError) { + exit $LASTEXITCODE + } + } + } + + # Apply patch(es) ###################################################### + wget "https://raw.githubusercontent.com/openwall/john-packages/main/patches/Remove-peflags-from-the-default-target.patch" -O 0001.patch + git apply 0001.patch + # 1. Remove peflags from the default target on Windows + + # Build ################################################################ + Write-Host "--------------------------------------------------------" + Write-Host " ===== Building ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + echo 'Compiler version' + shell "gcc --version" + echo '--------------------------------' + shell "gcc -dM -E -x c /dev/null" + echo '--------------------------------' + + # #### + # Redirect strderr to stdout. + # Otherwise it fails because of prints to stderr + # + CategoryInfo : NotSpecified: (ar: creating aes.a:String) [], RemoteException + # + FullyQualifiedErrorId : NativeCommandError + # #### + shell "./configure --enable-werror --disable-opencl --enable-simd=avx2 && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-best" + $EXE_NAME = "john-best.exe" + + # The "windows-package" make target depends on default, + # - So it needs the john.exe I built above + shell "cp ../run/$EXE_NAME ../run/john.exe" + + # Make this a Windows package + shell "make -s windows-package" + + # Use symlink.c to produce a tiny john.exe that executes the best SIMD + shell "make windows-tiny-link-to-john MAIN_NAME=$EXE_NAME " + ######################################################################## + # I should strip the tiny john.exe at some time in the future + # - But I can't call a make target that depends on default + # - So, I can't run a make strip here + ######################################################################## + + # Required dlls (Tested on Windows 7 32 bits and Windows 10 64 bits) + xcopy $cygwinFolder\cygwin1.dll ..\run\ + xcopy $cygwinFolder\cygbz2-1.dll ..\run\ + xcopy $cygwinFolder\cygcrypto-3.dll ..\run\ + xcopy $cygwinFolder\cyggomp-1.dll ..\run\ + xcopy $cygwinFolder\cyggmp-10.dll ..\run\ + xcopy $cygwinFolder\cygz.dll ..\run\ + xcopy $cygwinFolder\cygcrypt-2.dll ..\run\ + xcopy $cygwinFolder\cygOpenCL-1.dll ..\run\ + xcopy $cygwinFolder\cyggcc_s-seh-1.dll ..\run\ + + # Save CygWin Dlls + mkdir ..\lib + xcopy $cygwinFolder\*.dll ..\lib\ + + # The after_build ###################################################### + cd $env:JTR_FOLDER\run + + # Build info + ./john --list=build-info + displayName: 'Build JtR' + + # Clean up ################################################################# + - script: | + REM # Setup worker environment + SET PATH=%PATH%;C:\ProgramData\chocolatey\bin + cd $(Build.SourcesDirectory) + + REM # Save John the Ripper zip file + if exist "%JTR_FOLDER%\run\john.exe" 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=128m -ms=on "win_x%bits%.7z" "%JTR_FOLDER%" + move "win_x%bits%.7z" c:\ + displayName: 'Clean Up the Package' + + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: "c:\\win_x$(Bits).7z" + artifactName: "tmp-win_x$(Bits).7z" diff --git a/.azure/windows-build-to-delivery.yml b/.azure/windows-build-to-delivery.yml new file mode 100644 index 00000000000..73c7beaaade --- /dev/null +++ b/.azure/windows-build-to-delivery.yml @@ -0,0 +1,239 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# Azure DevOps CI configuration +# More info at https://github.com/openwall/john-packages +--- +steps: + - powershell: | + # Setup image environment ############################################## + $cygwinFolder = "C:\$env:cygwinPath" + + # Get upstream JtR source code + cd $env:PROJ_FOLDER + Remove-Item ./JtR -Force -Recurse -ErrorAction SilentlyContinue + git clone https://github.com/openwall/john.git JtR + + cd $env:BUILD_FOLDER + + # Force the build to be repeatable + git checkout "f3517213a576867423cd9de55e6f720b0339c6cd" + + Write-Host "--------------------------------------------------------" + Write-Host " ===== Deploying the release $RELEASE_COMMIT ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + # If needed (Cygwin is not installed) or as a workaround (Cygwin update is required) + if ($env:Cygwin -eq "install") { + Write-Host "--------------------------------------------------------" + Write-Host " ===== Installing Cygwin ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + choco install -y cygwin cyg-get + cyg-get libssl-devel libbz2-devel libgmp-devel zlib-devel gcc-core libOpenCL-devel libcrypt-devel make wget rebase perl + } + + # Powershell shell "Bash" run ########################################## + $posixBuildFolder = $env:BUILD_FOLDER -Replace '\\', '/' + + function shell($command, $dieOnError = $true) { + + Write-Host "Executing '$command'" + & "$cygwinFolder\bash" -lc ". /etc/profile && cd $posixBuildFolder && $command" + + if ($LASTEXITCODE -ne 0) { + Write-Host "'$command' failed with exit code $LASTEXITCODE! " -ForegroundColor Red -NoNewline + + if ($dieOnError) { + exit $LASTEXITCODE + } + } + } + + # Apply patch(es) ###################################################### + wget "https://raw.githubusercontent.com/openwall/john-packages/main/patches/Remove-peflags-from-the-default-target.patch" -O peflags.patch + git apply peflags.patch + # 1. Remove peflags from the default target on Windows + + # Build ################################################################ + Write-Host "--------------------------------------------------------" + Write-Host " ===== Building ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + echo 'Compiler version' + shell "gcc --version" + echo '--------------------------------' + shell "gcc -dM -E -x c /dev/null" + echo '--------------------------------' + + # #### + # Redirect strderr to stdout. + # It fails because of prints to stderr + # + CategoryInfo : NotSpecified: (ar: creating aes.a:String) [], RemoteException + # + FullyQualifiedErrorId : NativeCommandError + # #### + $EXE_NORMAL = "--enable-werror --disable-native-tests" + $EXE_NO_OMP = "--enable-werror --disable-native-tests --disable-openmp" + + # CPU (OMP and extensions fallback) + shell "./configure $EXE_NO_OMP --enable-simd=avx && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-avx" + shell "./configure $EXE_NORMAL --enable-simd=avx CPPFLAGS='-DOMP_FALLBACK_BINARY=\`"\\\`"john-avx\\\`"\`" ' && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-avx-omp" + shell "./configure $EXE_NO_OMP --enable-simd=avx2 && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-avx2" + shell "./configure $EXE_NORMAL --enable-simd=avx2 CPPFLAGS='-DOMP_FALLBACK_BINARY=\`"\\\`"john-avx2\\\`"\`" -DCPU_FALLBACK_BINARY=\`"\\\`"john-avx-omp\\\`"\`" ' && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-avx2-omp" + + shell "./configure $EXE_NO_OMP --enable-simd=avx512bw CPPFLAGS='-fno-asynchronous-unwind-tables ' && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-avx512bw" + shell "./configure $EXE_NORMAL --enable-simd=avx512bw CPPFLAGS='-fno-asynchronous-unwind-tables -DOMP_FALLBACK_BINARY=\`"\\\`"john-avx512bw\\\`"\`" -DCPU_FALLBACK_BINARY=\`"\\\`"john-avx2-omp\\\`"\`" ' && make -s clean && make -sj2 2>&1 && make -s strip && mv ../run/john ../run/john-avx512bw-omp" + $EXE_NAME = "john-avx512bw-omp.exe" + + # Configure OpenCL ICD + shell "mkdir -p ../etc/OpenCL/vendors" + shell "echo 'c:\Windows\System32\amdocl64.dll' > ../etc/OpenCL/vendors/amd.icd" + shell "echo 'c:\Windows\System32\nvopencl.dll' > ../etc/OpenCL/vendors/nvidia.icd" + shell "echo 'c:\Windows\System32\IntelOpenCL64.dll' > ../etc/OpenCL/vendors/intel.icd" + + # The "windows-package" make target depends on default, + # - So it needs the john.exe I built above + shell "cp ../run/$EXE_NAME ../run/john.exe" + + # Make this a Windows package + shell "make -s windows-package" + + # Save information about how the binaries were built + shell "echo '[Build Configuration]' > ../run/Defaults" + shell "echo 'System Wide Build=No' >> ../run/Defaults" + shell "echo 'OpenMP=No' >> ../run/Defaults" + shell "echo 'OpenCL=Yes' >> ../run/Defaults" + shell "echo 'Generic crypt(3) format=Yes' >> ../run/Defaults" + shell "echo 'libpcap=No' >> ../run/Defaults" + shell "echo 'Other Optional Libraries=Yes' >> ../run/Defaults" + shell "echo 'Regex, OpenMPI, Experimental Code, ZTEX=No' >> ../run/Defaults" + shell "echo '#' >> ../run/Defaults" + shell "echo '# The john (upstream) repository reference' >> ../run/Defaults" + shell "echo '[Repository john]' >> ../run/Defaults" + shell "echo 'Commit=f3517213a576867423cd9de55e6f720b0339c6cd' >> ../run/Defaults" + + # Use symlink.c to produce a tiny john.exe that executes the best SIMD + shell "make windows-tiny-link-to-john MAIN_NAME=$EXE_NAME " + ######################################################################## + # I should strip the tiny john.exe at some time in the future + # - But I can't call a make target that depends on default + # - So, I can't run a make strip here + ######################################################################## + + # Required dlls (Windows 10 64 bits) + xcopy $cygwinFolder\cygwin1.dll ..\run\ + xcopy $cygwinFolder\cygbz2-1.dll ..\run\ + xcopy $cygwinFolder\cygcrypto-3.dll ..\run\ + xcopy $cygwinFolder\cyggomp-1.dll ..\run\ + xcopy $cygwinFolder\cyggmp-10.dll ..\run\ + xcopy $cygwinFolder\cygz.dll ..\run\ + xcopy $cygwinFolder\cygcrypt-2.dll ..\run\ + xcopy $cygwinFolder\cygOpenCL-1.dll ..\run\ + xcopy $cygwinFolder\cyggcc_s-seh-1.dll ..\run\ + + # The after_build ###################################################### + cd $env:JTR_FOLDER\run + + # Build info + ./john --list=build-info + displayName: "Build JtR" + + - powershell: | + "$env:BUILD_BUILDID" | Out-File -FilePath C:\Build._ID -NoNewline -Encoding ASCII -Append + + displayName: "Save the Build ID value" + + - script: | + powershell -command 'Write-Host "---------------------------------------------------------"' + powershell -command 'Write-Host "== Enable ASLR and DEP for the Windows binary of JtR ==" -ForegroundColor White' + powershell -command 'Write-Host "---------------------------------------------------------"' + + REM # Setup worker environment + cd $(Build.SourcesDirectory)\run + + c:\%cygwinPath%\peflags --dynamicbase=true --nxcompat=true *.exe 2>&1 + displayName: "Enable ASLR and DEP for the binaries" + + # Clean up ################################################################# + - script: | + REM # Setup worker environment + SET PATH=%PATH%;C:\ProgramData\chocolatey\bin + cd $(Build.SourcesDirectory) + + REM # Remove the left-over from testing + del "%JTR_FOLDER%\run\john.log" + del "%JTR_FOLDER%\run\john.pot" + del "%JTR_FOLDER%\run\john-local.conf" + + REM # Remove unused/unneeded stuff + rmdir "%JTR_FOLDER%\run\ztex" /s /Q + + REM # Cleanup. Remove unnecessary files and folders + del "%JTR_FOLDER%\appveyor.yml" + del "%JTR_FOLDER%\azure-pipelines.yml" + del "%JTR_FOLDER%\.cirrus.yml" + del "%JTR_FOLDER%\.editorconfig" + del "%JTR_FOLDER%\.gitattributes" + del "%JTR_FOLDER%\.gitignore" + del "%JTR_FOLDER%\.mailmap" + del "%JTR_FOLDER%\.pre-commit.sh" + del "%JTR_FOLDER%\.travis.yml" + del "%JTR_FOLDER%\shell.nix" + del "%JTR_FOLDER%\requirements.txt" + + rmdir "%JTR_FOLDER%\.azure" /s /Q + rmdir "%JTR_FOLDER%\.ci" /s /Q + rmdir "%JTR_FOLDER%\.circleci" /s /Q + rmdir "%JTR_FOLDER%\.github" /s /Q + rmdir "%JTR_FOLDER%\.travis" /s /Q + + if exist "%JTR_FOLDER%\src\config.log" 7z a -tzip debug_logs.zip "%JTR_FOLDER%\src\config.log" > nul + if exist "%JTR_FOLDER%\src\configure" 7z a -tzip debug_logs.zip "%JTR_FOLDER%\src\configure" > nul + if exist "%JTR_FOLDER%\src\Makefile" 7z a -tzip debug_logs.zip "%JTR_FOLDER%\src\Makefile" > nul + move debug_logs.zip c:\ + + REM # Remove non distributable files + rmdir "%JTR_FOLDER%\.git" /s /Q + rmdir "%JTR_FOLDER%\src" /s /Q + + REM # Save John the Ripper zip file + if exist "%JTR_FOLDER%\run\john.exe" 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=128m -ms=on "win_x%bits%.7z" "%JTR_FOLDER%" + move "win_x%bits%.7z" c:\ + if exist "%JTR_FOLDER%\run\john.exe" 7z a -tzip -mx=9 "win_x%bits%.zip" "%JTR_FOLDER%" + move "win_x%bits%.zip" c:\ + displayName: "Clean Up the Package" + + # Compute checksums ######################################################## + - powershell: | + Write-Host "--------------------------------------------------------" + Write-Host " ===== Compute and Save Checksums ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + # Setup worker environment + cd $(Build.SourcesDirectory)\run + + if ($Zipfile = Get-ChildItem "c:\win_x$env:Bits.7z") { + # Print files hashes + Get-FileHash "c:\win_x$env:Bits.*" + } + + Write-Output "**************************************************************************" + Write-Output "File verification is the process of using an algorithm for verifying the integrity of a computer file. A popular approach is to store checksums (hashes) of files, also known as message digests, for later comparison." | Tee-Object -FilePath c:\checksums.txt + Write-Output "**************************************************************************" | Tee-Object -FilePath c:\checksums.txt -Append + Get-FileHash -Path .\*.exe | Tee-Object -FilePath c:\checksums.txt -Append + displayName: "Compute and Save Checksums" diff --git a/.azure/windows-ci.yml b/.azure/windows-ci.yml new file mode 100644 index 00000000000..534e7ee44e0 --- /dev/null +++ b/.azure/windows-ci.yml @@ -0,0 +1,42 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2023 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +steps: + - template: checkout.yml + - template: windows-system-info.yml + - template: windows-build-and-test-steps.yml + + - task: DownloadBuildArtifacts@1 + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: "tmp-win_x$(Bits).7z" + downloadPath: '$(System.ArtifactsDirectory)' + + - script: | + SET PATH=%PATH%;C:\ProgramData\chocolatey\bin + cd $(System.ArtifactsDirectory) + 7z x tmp-win_x64.7z + displayName: 'Get the Build Artifact' + + - template: windows-testing.yml + parameters: + fullTest: 'yes' + johnBinary: 'john' + johnDirectory: $(System.ArtifactsDirectory)\JtR\run diff --git a/.azure/windows-pull-artifacts.yml b/.azure/windows-pull-artifacts.yml new file mode 100644 index 00000000000..7f4517b1fcc --- /dev/null +++ b/.azure/windows-pull-artifacts.yml @@ -0,0 +1,40 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +steps: + - powershell: | + # Windows 2012 does not have Chocolatey installed + if ($env:SYSTEM_PHASENAME -eq "Windows_2012") { + Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + choco install -y 7zip.install + } + displayName: 'Install Missing Software' + + - task: DownloadPipelineArtifact@1 + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: "win_x$(Bits).7z" + downloadPath: '$(System.ArtifactsDirectory)' + + - script: | + SET PATH=%PATH%;C:\ProgramData\chocolatey\bin + cd $(System.ArtifactsDirectory) + 7z x win_x64.7z + displayName: 'Get the Build Artifact' \ No newline at end of file diff --git a/.azure/windows-push-artifacts.yml b/.azure/windows-push-artifacts.yml new file mode 100644 index 00000000000..4d0c3d56335 --- /dev/null +++ b/.azure/windows-push-artifacts.yml @@ -0,0 +1,51 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +steps: + # There are two kinds of artifacts publication ############### + # - PublishBuildArtifacts (pathtoPublish) + # - DownloadBuildArtifacts + # - PublishPipelineArtifact (targetPath) + # - DownloadPipelineArtifact + # ############################################################ + - task: PublishPipelineArtifact@1 + inputs: + targetPath: "c:\\win_x$(Bits).7z" + artifactName: "win_x$(Bits).7z" + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: "c:\\win_x$(Bits).zip" + artifactName: "win_x$(Bits).zip" + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: "c:\\Build._ID" + artifactName: "Build._ID" + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: "c:\\debug_logs.zip" + artifactName: Logs + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: "c:\\checksums.txt" + artifactName: Checksums + diff --git a/.azure/windows-system-info.yml b/.azure/windows-system-info.yml new file mode 100644 index 00000000000..2d5fcf7d6cc --- /dev/null +++ b/.azure/windows-system-info.yml @@ -0,0 +1,27 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + steps: + - powershell: | + Write-Host "---------------------------------------------------------" + Get-ChildItem Env: + Write-Host "---------------------------------------------------------" + systeminfo + Write-Host "---------------------------------------------------------" + displayName: 'System Information' diff --git a/.azure/windows-testing.yml b/.azure/windows-testing.yml new file mode 100644 index 00000000000..fc61fb8173b --- /dev/null +++ b/.azure/windows-testing.yml @@ -0,0 +1,61 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +parameters: + fullTest: '' + johnBinary: 'john' + johnDirectory: $(Build.SourcesDirectory)\run + +steps: + - script: | + powershell -command 'Write-Host "--------------------------------------------------------"' + powershell -command 'Write-Host " ===== Testing ===== " -ForegroundColor White' + powershell -command 'Write-Host "--------------------------------------------------------"' + + REM # Setup worker environment + cd ${{ parameters.johnDirectory }} + + echo "====> Build Info" + ${{ parameters.johnBinary }} --list=build-info + + echo $NT$066ddfd4ef0e9cd7c256fe77191ef43c > tests.in + echo $NT$8846f7eaee8fb117ad06bdd830b7586c >> tests.in + echo df64225ca3472d32342dd1a33e4d7019f01c513ed7ebe85c6af102f6473702d2 >> tests.in + echo 73e6bc8a66b5cead5e333766963b5744c806d1509e9ab3a31b057a418de5c86f >> tests.in + echo $6$saltstring$fgNTR89zXnDUV97U5dkWayBBRaB0WIBnu6s4T7T8Tz1SbUyewwiHjho25yWVkph2p18CmUkqXh4aIyjPnxdgl0 >> tests.in + + if "${{ parameters.fullTest }}" == "yes" ( + echo "====> T0:" + ${{ parameters.johnBinary }} -test-full=0 --format=cpu 2>&1 + ) + + echo "====> T6.0:" + ${{ parameters.johnBinary }} -test=3 -form='dynamic=md5(sha1($s).md5($p))' 2>&1 + echo "====> T6.1:" + ${{ parameters.johnBinary }} -test=3 -form='dynamic=md5(sha1($s.$p).md5($p))' 2>&1 + echo "====> T6.2:" + ${{ parameters.johnBinary }} -test=3 -form='dynamic=md5($p)' 2>&1 + + echo "====> T10:" + ${{ parameters.johnBinary }} tests.in --format=nt --fork=2 --max-run-time=300 2>&1 + echo "====> T11:" + ${{ parameters.johnBinary }} tests.in --format=raw-sha256 --fork=2 --max-run-time=300 2>&1 + echo "====> T12:" + ${{ parameters.johnBinary }} tests.in --format=sha512crypt --mask=jo?l[n-q] 2>&1 + displayName: 'Testing' diff --git a/.azure/windows-variables.yml b/.azure/windows-variables.yml new file mode 100644 index 00000000000..4ba5435778c --- /dev/null +++ b/.azure/windows-variables.yml @@ -0,0 +1,43 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +variables: + - name: Cygwin + value: "install" + + - name: BUILD_FOLDER + value: "$(Build.SourcesDirectory)\\src" + + - name: JTR_FOLDER + value: "$(Build.SourcesDirectory)" + + - name: PROJ_FOLDER + value: "$(Agent.BuildDirectory)" + + - name: cygwinPath + value: "tools\\cygwin\\bin" + + - name: Bits + value: "64" + + - name: Arch + value: "x86_64" + + - name: Test + value: "package" \ No newline at end of file diff --git a/.ci/helper.sh b/.ci/helper.sh new file mode 100755 index 00000000000..83681b93d69 --- /dev/null +++ b/.ci/helper.sh @@ -0,0 +1,111 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + +function do_Install_OpenCL(){ + echo + echo '-- Test Suite set up --' + + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update -qq + sudo apt-get install -y \ + intel-oneapi-runtime-opencl intel-basekit +} + +function do_Edit_Configuration(){ + sed -i 's/time make $j check/# ==> /g' .ci/run-build-and-tests.sh + sed -i 's/if git status --porcelain |grep ^.;/if false;/g' .ci/run-build-and-tests.sh +} + +function do_Disable_Formats(){ + tasks="$1" + echo '[Local:Disabled:Formats]' > run/john-local.conf + + # CPU formats => Error processing POT + # OpenCL formats => Expected count(s) + if [[ "$tasks" == *"internal"* ]]; then + disable_list=" + adxcrypt + as400-des + bcrypt + descrypt + lm + net-ah + nethalflm + netlm + pst + racf + rvary + sapb + tripcode + vnc + argon2-opencl + bcrypt-opencl + descrypt-opencl + keepass-argon2-opencl + krb5tgs-opencl + lm-opencl + o5logon-opencl + pgpdisk-opencl + pfx-opencl + sha256crypt-opencl + zip-opencl + " + fi + for i in $disable_list; do + echo "$i = Y" >> run/john-local.conf + done + + # OpenCL descrypt builds for all 4096 salts, it is unusable inside CI + if [[ "$tasks" == *"opencl"* ]]; then + disable_list=" + bcrypt-opencl + descrypt-opencl + krb5pa-md5-opencl + lm-opencl + mscash-opencl + nt-opencl + ntlmv2-opencl + o5logon-opencl + sha256crypt-opencl + zip-opencl + " + fi + for i in $disable_list; do + echo "$i = Y" >> run/john-local.conf + done + + # Failures => Expected count(s) + if [[ "$tasks" == *"regular"* ]]; then + disable_list=" + descrypt + lm + netlm + pst + sapB + vnc + " + fi + for i in $disable_list; do + echo "$i = Y" >> run/john-local.conf + done +} diff --git a/.ci/tests-ci.sh b/.ci/tests-ci.sh new file mode 100755 index 00000000000..344ccce4b03 --- /dev/null +++ b/.ci/tests-ci.sh @@ -0,0 +1,210 @@ +#!/bin/bash -e + +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + +# ----------- BUILD ----------- +cd src + +# Setup testing environment +JTR=../run/john +arch=$(uname -m) + +# Control System Information presentation +if [[ $2 == "TEST" ]]; then + MUTE_SYS_INFO="Yes" +fi + +# The new J2 Docker image does not have wget installed +if [[ "$EXTRA" == "SIMD" ]]; then + apt-get update + apt-get -y install wget +fi + +if [[ $TARGET_ARCH == *"SOLARIS"* && $2 == "BUILD" ]]; then + pkg install --accept gcc +fi + +TASK_RUNNING="$2" +wget https://raw.githubusercontent.com/openwall/john-packages/release/scripts/show_info.sh -O show_info.sh +source show_info.sh + +function do_TS_Setup(){ + echo + echo '-- Test Suite set up --' + + # Prepare environment + cd .. || exit 1 + git clone --depth 1 https://github.com/openwall/john-tests tests + cd tests || exit 1 + + export PERL_MM_USE_DEFAULT=1 + (echo y;echo o conf prerequisites_policy follow;echo o conf commit)| sudo cpan + sudo cpan install Digest::MD5 +} + +function do_build () { + set -e + + if [[ -n "$MAKE_CMD" ]]; then + MAKE=$MAKE_CMD + else + MAKE=make + fi + + if [[ -z "$MAKE_FLAGS" ]]; then + MAKE_FLAGS="-sj $(nproc)" + fi + + if [[ -n "$1" ]]; then + $MAKE -s clean && $MAKE $MAKE_FLAGS && mv ../run/john "$1" + else + $MAKE -s clean && $MAKE $MAKE_FLAGS + fi + set +e +} + +function do_release () { + set -e + + #Create a 'john' executable + cd ../run + ln -s "$1" john + cd - + + # Save information about how the binaries were built + echo "[Build Configuration]" > ../run/Defaults + echo "System Wide Build=No" >> ../run/Defaults + echo "Architecture=$arch" >> ../run/Defaults + echo "OpenMP=No" >> ../run/Defaults + echo "OpenCL=Yes" >> ../run/Defaults + echo "Optional Libraries=Yes" >> ../run/Defaults + echo "Regex, OpenMPI, Experimental Code, ZTEX=No" >> ../run/Defaults + + # The script that computes the package version + wget https://raw.githubusercontent.com/openwall/john-packages/release/scripts/package_version.sh + chmod +x package_version.sh + echo "Version=$(./package_version.sh)" >> ../run/Defaults + + set +e +} + +# Build and testing +if [[ $2 == "BUILD" ]]; then + + # Make it a reproducible build + if [[ -n "$_JUMBO_RELEASE" ]]; then + echo "Deploying the release $_JUMBO_RELEASE" + git pull --unshallow + git checkout "$_JUMBO_RELEASE" + fi + + if [[ $TARGET_ARCH == *"macOS"* ]]; then + SYSTEM_WIDE='' + REGULAR="$SYSTEM_WIDE $ASAN $BUILD_OPTS" + NO_OPENMP="--disable-openmp $SYSTEM_WIDE $ASAN $BUILD_OPTS" + + #Libraries and Includes + if [[ $TARGET_ARCH == *"macOS X86"* ]]; then + MAC_LOCAL_PATH="usr/local/opt" + else + MAC_LOCAL_PATH="opt/homebrew/opt" + fi + LDFLAGS_ssl="-L/$MAC_LOCAL_PATH/openssl/lib" + LDFLAGS_gmp="-L/$MAC_LOCAL_PATH/gmp/lib" + LDFLAGS_omp="-L/$MAC_LOCAL_PATH/libomp/lib -lomp" + + CFLAGS_ssl="-I/$MAC_LOCAL_PATH/openssl/include" + CFLAGS_gmp="-I/$MAC_LOCAL_PATH/gmp/include" + CFLAGS_omp="-I/$MAC_LOCAL_PATH/libomp/include" + + brew update + brew install openssl libpcap libomp gmp coreutils p7zip + + if [[ $TARGET_ARCH == *"macOS ARM"* ]]; then + brew link openssl --force + fi + + if [[ $TARGET_ARCH == *"macOS X86"* ]]; then + ./configure $NO_OPENMP --enable-simd=avx && do_build ../run/john-avx + ./configure $REGULAR --enable-simd=avx LDFLAGS="$LDFLAGS_omp" CPPFLAGS="-Xclang -fopenmp $CFLAGS_omp -DOMP_FALLBACK_BINARY=\"\\\"john-avx\\\"\" " && do_build ../run/john-avx-omp + ./configure $NO_OPENMP --enable-simd=avx2 && do_build ../run/john-avx2 + ./configure $REGULAR --enable-simd=avx2 LDFLAGS="$LDFLAGS_omp" CPPFLAGS="-Xclang -fopenmp $CFLAGS_omp -DOMP_FALLBACK_BINARY=\"\\\"john-avx2\\\"\" -DCPU_FALLBACK_BINARY=\"\\\"john-avx-omp\\\"\" " && do_build ../run/john-avx2-omp + BINARY="john-avx2-omp" + else + ./configure $NO_OPENMP LDFLAGS="$LDFLAGS_ssl $LDFLAGS_gmp" CPPFLAGS="$CFLAGS_ssl $CFLAGS_gmp" && do_build "../run/john-$arch" + ./configure $REGULAR LDFLAGS="$LDFLAGS_ssl $LDFLAGS_gmp $LDFLAGS_omp" CPPFLAGS="-Xclang -fopenmp $CFLAGS_ssl $CFLAGS_gmp $CFLAGS_omp -DOMP_FALLBACK_BINARY=\"\\\"john-$arch\\\"\" " && do_build ../run/john-omp + BINARY="john-omp" + fi + do_release $BINARY + fi + + if [[ $TARGET_ARCH == *"SOLARIS"* ]]; then + ./configure $ASAN $BUILD_OPTS + export MAKE_CMD=gmake + do_build + fi + + if [[ $TARGET_ARCH == *"NIX"* ]]; then + ./configure $ASAN $BUILD_OPTS + do_build + fi + echo + echo '-- Build Info --' + $WINE $JTR --list=build-info || true + +elif [[ $2 == "TEST" ]]; then + + # Required defines + TEST=";$EXTRA;" # Controls how the test will happen + arch=$(uname -m) + JTR_BIN="$WINE$JTR" + JTR_CL="" + + if [[ $TARGET_ARCH == "DOCKER" ]]; then + JTR_BIN="/john/run/john-avx" + fi + + wget https://raw.githubusercontent.com/openwall/john-packages/release/scripts/run_tests.sh -O run_tests.sh + source run_tests.sh + +elif [[ "$TEST" == *"TS"* ]]; then + # Test Suite set up + do_TS_Setup + + if [[ "$TEST" == *";OPENCL;"* ]]; then + # Show OpenCL info + ../run/john --list=opencl-devices + fi + ../run/john --list=build-info + + if [[ "$TEST" == *"TS --restore;"* ]]; then + ./jtrts.pl --restore + + elif [[ "$TEST" == *"TS --internal;"* ]]; then + ./jtrts.pl -noprelims -internal enabled + else + if [[ "$TEST" != *";OPENCL;"* ]]; then + ./jtrts.pl -dynamic none + else + ./jtrts.pl -noprelims -type opencl + fi + fi +fi diff --git a/.circleci/circle-ci.sh b/.circleci/circle-ci.sh deleted file mode 100755 index 3123c249fe9..00000000000 --- a/.circleci/circle-ci.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -e - -function do_Copy_Dlls(){ - echo - echo '-- Copying Dlls --' - - basepath="/usr/$TARGET_ARCH-w64-mingw32/sys-root/mingw/bin" - - cp "$basepath/libgomp-1.dll" ../run - cp "$basepath/libgmp-10.dll" ../run - cp "$basepath/libbz2-1.dll" ../run - cp "$basepath/libwinpthread-1.dll" ../run - cp "$basepath/zlib1.dll" ../run - cp "$basepath"/libcrypto-1*.dll ../run - cp "$basepath"/libssl-1*.dll ../run - - if [[ "$TARGET_ARCH" == "x86_64" ]]; then - cp "$basepath/libgcc_s_seh-1.dll" ../run - fi - - if [[ "$TARGET_ARCH" == "i686" ]]; then - cp "$basepath/libgcc_s_sjlj-1.dll" ../run - fi - echo '-- Done --' -} - -# ---- Build and test JtR ---- -cd src - -# The testing binary -JTR=../run/john - -# Build and testing -if [[ $1 == "BUILD" ]]; then - - if [[ "$PLUGS" == "none" ]]; then - rm -f *plug.[ch] - fi - - if [[ -n "$WINE" ]]; then - do_Copy_Dlls - export WINEDEBUG=-all - fi - - # Configure and build - if [[ "$TARGET_ARCH" == "i686" ]]; then - ./configure --host=i686-w64-mingw32 --build=i686-redhat-linux-gnu --target=i686-w64-mingw32 $BUILD_OPTS - fi - - if [[ "$TARGET_ARCH" == "x86_64" ]]; then - ./configure --host=x86_64-w64-mingw32 --build=x86_64-redhat-linux-gnu --target=x86_64-w64-mingw64 $BUILD_OPTS - fi - - if [[ -z "$WINE" ]]; then - ./configure $BUILD_OPTS - fi - - if [[ -n "$UNIT_TESTS" ]]; then - make -sj4 unit-tests - fi - - make -sj4 - - echo '---------------------------------- Build Info ----------------------------------' - $WINE $JTR --list=build-info - echo '--------------------------------------------------------------------------------' - -elif [[ $1 == "TEST" ]]; then - # Disable problematic formats before testing - source ../.ci/disable_formats.sh - - echo '---------------------------------- Build Info ----------------------------------' - $WINE $JTR --list=build-info - echo '--------------------------------------------------------------------------------' - - if [[ -n "$WINE" ]]; then - # Wine and MinGW setup - do_Copy_Dlls - export WINEDEBUG=-all - - echo - echo '-- Testing JtR --test=0 --' - $WINE $JTR --test=0 - - elif [[ -n "$ENCODING_TEST" ]]; then - echo "-- Running \$JTR --test-full=0 --format=$ENCODING_TEST '--encoding=utf8' --" - $JTR --test-full=0 --format="$ENCODING_TEST" --encoding=utf8 - - echo - echo "-- Running \$JTR --test-full=0 --format=$ENCODING_TEST '--encoding=cp737' --" - $JTR --test-full=0 --format="$ENCODING_TEST" --encoding=cp737 - - elif [[ -n "$ASAN_TEST" && -n "$FULL_TEST" ]]; then - echo "-- Running \$JTR --test-full=0 --" - $JTR --test-full=0 - - elif [[ -n "$FORMATS" ]]; then - echo "-- Running \$JTR --test=0 --format=$FORMATS --" - $JTR --test=0 --format=${FORMATS} - - else - echo "-- Running \$JTR --test=0 --" - $JTR --test=0 - fi -fi diff --git a/.circleci/config.yml b/.circleci/config.yml index 05d9ca0bab7..161c686b2ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,145 +1,186 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2023 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# Circle CI configuration +# More info at https://github.com/openwall/john-packages + version: 2 jobs: common_linux: &common_linux docker: - - image: ghcr.io/openwall/john-ci:fedora.32 + - image: ghcr.io/openwall/john-ci:fedora.latest steps: - checkout - run: name: Building JtR - command: .circleci/circle-ci.sh BUILD + command: .ci/tests-ci.sh $TARGET_ARCH BUILD - run: name: Testing JtR - command: .circleci/circle-ci.sh TEST + command: .ci/tests-ci.sh $TARGET_ARCH TEST - wine-32bits: + linux-Ubuntu-Dev: <<: *common_linux docker: - - image: ghcr.io/openwall/john-ci:fedora.30 + - image: ghcr.io/openwall/john-ci:ubuntu.devel environment: - TARGET_ARCH: "i686" - WINE: "wine" + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + BUILD_OPTS: "--enable-werror" OMP_NUM_THREADS: 2 - wine-64bits: + linux-Fedora: <<: *common_linux docker: - - image: ghcr.io/openwall/john-ci:fedora.32 + - image: ghcr.io/openwall/john-ci:fedora.latest environment: - TARGET_ARCH: "x86_64" - WINE: "wine" + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + BUILD_OPTS: "--enable-werror" OMP_NUM_THREADS: 2 - no-plugs: + make-check: <<: *common_linux docker: - - image: ghcr.io/openwall/john-ci:opencl + - image: ghcr.io/openwall/john-ci:fedora.latest environment: - OMP_NUM_THREADS: 2 - PLUGS: "none" - UNIT_TESTS: "yes" - BUILD_OPTS: "--enable-werror CPPFLAGS=-DDYNAMIC_DISABLED" + TARGET_ARCH: "NIX" + EXTRA: "CHECK;" + ASAN: "--enable-asan" + OMP_NUM_THREADS: 3 - encoding-cpu: + no-omp: <<: *common_linux docker: - image: ghcr.io/openwall/john-ci:fedora.latest environment: - OMP_NUM_THREADS: 2 - ENCODING_TEST: "cpu" + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + BUILD_OPTS: "--enable-werror --disable-openmp" - encoding-opencl: + no-simd: <<: *common_linux docker: - - image: ghcr.io/openwall/john-ci:opencl18 + - image: ghcr.io/openwall/john-ci:fedora.latest environment: + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + BUILD_OPTS: "--enable-werror --disable-simd" OMP_NUM_THREADS: 2 - ENCODING_TEST: "opencl" - asan: + no-simd-omp: <<: *common_linux docker: - image: ghcr.io/openwall/john-ci:fedora.latest environment: - OMP_NUM_THREADS: 2 - ASAN_TEST: "yes" - BUILD_OPTS: "--enable-asan --disable-opencl" + EXTRA: "full;extra;crack;" + TARGET_ARCH: "NIX" + BUILD_OPTS: "--enable-werror --disable-simd --disable-openmp" - test-full: + omp-fast-formats: <<: *common_linux docker: - image: ghcr.io/openwall/john-ci:fedora.latest environment: - ASAN_TEST: "yes" - FULL_TEST: "yes" - BUILD_OPTS: "--enable-asan --disable-openmp --disable-opencl" + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + BUILD_OPTS: "--enable-werror --enable-openmp-for-fast-formats --enable-simd=avx2" + OMP_NUM_THREADS: 2 - fast-formats-omp: + simd-latest: <<: *common_linux docker: - - image: ghcr.io/openwall/john-ci:fedora.latest + - image: ghcr.io/openwall/john + user: root environment: - OMP_NUM_THREADS: 2 - ASAN_TEST: "yes" - FULL_TEST: "yes" - BUILD_OPTS: "--enable-asan --enable-openmp-for-fast-formats --disable-opencl" + TARGET_ARCH: "DOCKER" + EXTRA: "SIMD" + OMP_NUM_THREADS: 4 + resource_class: large - fast-formats-omp-x-non-SIMD: + simd-bleeding: <<: *common_linux docker: - - image: ghcr.io/openwall/john-ci:fedora.latest + - image: ghcr.io/openwall/john:bleeding + user: root environment: - OMP_NUM_THREADS: 2 - ASAN_TEST: "yes" - FULL_TEST: "yes" - BUILD_OPTS: "--enable-asan --enable-openmp-for-fast-formats --disable-simd --disable-opencl" + TARGET_ARCH: "DOCKER" + EXTRA: "SIMD" + OMP_NUM_THREADS: 4 + resource_class: large - arm: + flatpak: machine: image: ubuntu-2204:current - environment: - DEBIAN_FRONTEND: "noninteractive" - resource_class: arm.medium + environment: + OMP_NUM_THREADS: 2 + TEST: ";full;extra;OpenCL-info;" + arch: "x86_64" + JTR_BIN: "john" + FLATPAK: "true" + steps: - - checkout - run: - name: Preparing + name: Initialising command: | - uname -a - sudo apt update && sudo apt install -y zlib1g-dev libgmp-dev libpcap-dev libbz2-dev + sudo apt-get update && sudo apt-get install -y flatpak + wget https://github.com/openwall/john-packages/releases/download/bleeding/flatpak_1_JtR.zip + unzip flatpak_1_JtR.zip + sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + sudo flatpak install -y flathub org.freedesktop.Platform//24.08 + flatpak install --user -y --bundle john.flatpak - run: - name: Building JtR - command: .circleci/circle-ci.sh BUILD + name: System Information + command: | + flatpak run com.openwall.John + flatpak run com.openwall.John --list=build-info - run: - name: Testing JtR - command: .circleci/circle-ci.sh TEST + name: Testing + command: | + wget https://raw.githubusercontent.com/openwall/john-packages/release/scripts/run_tests.sh + source run_tests.sh workflows: version: 2 build: jobs: - - asan - - arm - - encoding-cpu - - wine-64bits - - no-plugs + - linux-Ubuntu-Dev + - make-check + - no-simd - - encoding-opencl: + - no-omp + - no-simd-omp: requires: - - encoding-cpu - - wine-32bits: + - no-omp + + - linux-Fedora + - omp-fast-formats: requires: - - wine-64bits + - linux-Fedora - - more-tests: + - extras: type: approval - - - test-full: + - simd-latest: requires: - - more-tests - - fast-formats-omp: + - extras + - simd-bleeding: requires: - - more-tests - - fast-formats-omp-x-non-SIMD: + - extras + - flatpak: requires: - - more-tests + - extras diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000000..24aa33efce2 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,135 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2023 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# Cirrus CI configuration +# More info at https://github.com/openwall/john-packages + +freebsd_task: + name: FreeBSD + + matrix: + - name: FreeBSD 13 + freebsd_instance: + image_family: freebsd-13-4-snap + - name: FreeBSD 14 + freebsd_instance: + image_family: freebsd-14-2-snap + - name: FreeBSD 15 + freebsd_instance: + image_family: freebsd-15-0-snap + + env: + CIRRUS_CLONE_DEPTH: "10" + CC: "clang" + BUILD_OPS: "--enable-werror" + MAKE_FLAGS: "-sj4" + TARGET_ARCH : "FreeBSD" + EXTRA: "full;extra" + TEST : "FreeBSD;" + BASE : "Unix like FreeBSD" + IGNORE_OSVERSION: "yes" # debug: try to skip a FreeBSD version mismatch seeing in v. 14. + + pkginstall_script: + - pkg update -f + - pkg install -y devel/gmake wget perl5 bash + + info_script: + - bash .ci/tests-ci.sh $TARGET_ARCH INFO + + build_script: + - cd src + - ./configure "$BUILD_OPS" + - gmake "$MAKE_FLAGS" + + test_script: + - bash .ci/tests-ci.sh $TARGET_ARCH TEST +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2023-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# Cirrus CI configuration +# More info at https://github.com/openwall/john-packages + +#--- +macOS_task: + name: macOS M2 + trigger_type: manual + macos_instance: + image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest + + env: + CIRRUS_CLONE_DEPTH: "10" + BUILD_OPS: "--build=aarch64-apple-darwin" + CC: "clang" + MAKE_FLAGS: "-sj4" + TARGET_ARCH: "macOS ARM" + EXTRA: "full;extra" + TEST: "macOS;" + BASE: "Apple macOS M2" + DEPLOY_PAK: "Yes" + RELEASE_COMMIT: "f3517213a576867423cd9de55e6f720b0339c6cd" + + info_script: | + git clone --depth 10 https://github.com/openwall/john.git ~/tmp + cp -r ~/tmp/. . + + wget https://raw.githubusercontent.com/openwall/john-packages/main/scripts/ci_controller.sh \ + -O .ci/ci_controller.sh + chmod +x .ci/ci_controller.sh + .ci/ci_controller.sh "$TARGET_ARCH" INFO + echo "$CIRRUS_TASK_ID" > Build._ID + + build_script: | + .ci/ci_controller.sh "$TARGET_ARCH" BUILD + + # Format crash on ARM + echo '[Local:Disabled:Formats]' >> run/john-local.conf + echo 'SunMD5 = Y' >> run/john-local.conf + .ci/ci_controller.sh "$TARGET_ARCH" TEST + + package_script: | + wget https://raw.githubusercontent.com/openwall/john-packages/main/scripts/clean_package.sh \ + -O .ci/clean_package.sh + source .ci/clean_package.sh + + 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=128m -ms=on JtR-macArm.7z ./ + 7z a -tzip -mx=9 JtR-macArm.zip ./ + sha256sum -- JtR-macArm.* + + always: + binaries_artifacts: + path: "JtR-macArm.*" + + id_artifacts: + path: "Build._ID" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 43535367943..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,337 +0,0 @@ -name: CI - -on: [push, pull_request] - -jobs: - whitespace-errors: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: check - run: git diff-index --check --cached b1b622f691d40196815939e4736a5da71befd206 - - asan: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-fuzz --enable-asan - - asan-disable-all: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-asan --disable-openmp --disable-simd --without-openssl - - asan-disable-openmp: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-asan --disable-openmp - - asan-without-openssl: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-asan --without-openssl - - asan-disable-simd: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-asan --disable-simd - - asan-sse2: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-asan --enable-simd=sse2 - - asan-avx: - runs-on: ubuntu-latest - env: - CC: gcc - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --enable-asan --enable-simd=avx - - gcc14-x86-without-openssl: - runs-on: ubuntu-24.04 - env: - CC: gcc-14 - TARGET: x86 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --without-openssl - - gcc14-x86-disable-all: - runs-on: ubuntu-24.04 - env: - CC: gcc-14 - TARGET: x86 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh --disable-openmp --disable-simd --without-openssl - - gcc14-x86_64: - runs-on: ubuntu-24.04 - env: - CC: gcc-14 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - gcc13-x86_64: - runs-on: ubuntu-latest - env: - CC: gcc-13 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - gcc12-x86_64: - runs-on: ubuntu-latest - env: - CC: gcc-12 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - gcc11-x86_64: - runs-on: ubuntu-latest - env: - CC: gcc-11 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - gcc10-x86_64: - runs-on: ubuntu-latest - env: - CC: gcc-10 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - gcc9-x86_64: - runs-on: ubuntu-latest - env: - CC: gcc-9 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - gcc8-x86_64: - runs-on: ubuntu-20.04 - env: - CC: gcc-8 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang18-x86_64: - runs-on: ubuntu-24.04 - env: - CC: clang-18 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang17-x86_64: - runs-on: ubuntu-24.04 - env: - CC: clang-17 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang16-x86_64: - runs-on: ubuntu-24.04 - env: - CC: clang-16 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang15-x86_64: - runs-on: ubuntu-latest - env: - CC: clang-15 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang14-x86_64: - runs-on: ubuntu-latest - env: - CC: clang-14 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang13-x86_64: - runs-on: ubuntu-22.04 - env: - CC: clang-13 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang12-x86_64: - runs-on: ubuntu-22.04 - env: - CC: clang-12 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang11-x86_64: - runs-on: ubuntu-22.04 - env: - CC: clang-11 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang10-x86_64: - runs-on: ubuntu-latest - env: - CC: clang - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang9-x86_64: - runs-on: ubuntu-20.04 - env: - CC: clang-9 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh - - clang8-x86_64: - runs-on: ubuntu-20.04 - env: - CC: clang-8 - TARGET: x86_64 - steps: - - uses: actions/checkout@v4 - - name: install dependencies - run: .ci/install-dependencies.sh - - name: build check - run: .ci/run-build-and-tests.sh diff --git a/.github/workflows/solaris.yml b/.github/workflows/solaris.yml new file mode 100644 index 00000000000..f575804b2bd --- /dev/null +++ b/.github/workflows/solaris.yml @@ -0,0 +1,71 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2023-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# GitHub Actions CI configuration +# More info at https://github.com/openwall/john-packages + +--- +name: Solaris CI + +"on": + workflow_dispatch: + inputs: + hash: + description: "The commit hash to be used" + required: false + default: "f3517213a576867423cd9de55e6f720b0339c6cd" + +jobs: + test: + runs-on: ubuntu-latest + name: Solaris 11 + env: + TARGET_ARCH: "SOLARIS" + EXTRA: "full;extra;CHECK" + BUILD_OPTS: "" + BASE: "Oracle Solaris" + RELEASE_COMMIT: ${{ github.event.inputs.hash }} + MAKE_CMD: gmake + + steps: + - uses: actions/checkout@v4 + - name: Build on Solaris + id: test + uses: vmactions/solaris-vm@v1 + with: + envs: "TARGET_ARCH EXTRA BUILD_OPTS TEST BASE RELEASE_COMMIT MAKE_CMD" + usesh: true + copyback: false + prepare: | + pkgutil -y -i socat + pkgutil -y -i git + + run: | + echo '--------------------------------' + echo " Solaris Environment" + echo '--------------------------------' + git clone --depth 10 https://github.com/openwall/john.git ~/tmp + cd ~/tmp + + wget https://raw.githubusercontent.com/openwall/john-packages/main/scripts/ci_controller.sh \ + -O .ci/ci_controller.sh + chmod +x .ci/ci_controller.sh + + .ci/ci_controller.sh $TARGET_ARCH BUILD + .ci/ci_controller.sh $TARGET_ARCH TEST diff --git a/.github/workflows/ts.yml b/.github/workflows/ts.yml new file mode 100644 index 00000000000..94f9e9a9a67 --- /dev/null +++ b/.github/workflows/ts.yml @@ -0,0 +1,109 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2024 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### + +--- +name: TS Suite Testing + +"on": + workflow_dispatch: + +jobs: + TS: + runs-on: ubuntu-latest + env: + CC: gcc + TARGET: x86_64 + TEST: "TS;" + + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + .ci/install-dependencies.sh + source .ci/helper.sh + + - name: Build + run: | + source .ci/helper.sh + do_Edit_Configuration + .ci/run-build-and-tests.sh + + - name: Test + run: | + source .ci/helper.sh + export MUTE_SYS_INFO=1 + do_Disable_Formats regular + .ci/tests-ci.sh + + TS-opencl: + runs-on: ubuntu-latest + env: + CC: gcc + TARGET: x86_64 + TEST: "TS;OPENCL;" + + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + .ci/install-dependencies.sh + source .ci/helper.sh + do_Install_OpenCL + + - name: Build + run: | + source .ci/helper.sh + do_Edit_Configuration + .ci/run-build-and-tests.sh + + - name: Test + run: | + source .ci/helper.sh + export MUTE_SYS_INFO=1 + do_Disable_Formats opencl + .ci/tests-ci.sh + + TS-internal: + runs-on: ubuntu-latest + env: + CC: gcc + TARGET: x86_64 + TEST: "TS --internal;OPENCL;" + + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + .ci/install-dependencies.sh + source .ci/helper.sh + do_Install_OpenCL + + - name: Build + run: | + source .ci/helper.sh + do_Edit_Configuration + .ci/run-build-and-tests.sh + + - name: Test + run: | + source .ci/helper.sh + export MUTE_SYS_INFO=1 + do_Disable_Formats internal + .ci/tests-ci.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fa9bfb39d7f..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,62 +0,0 @@ -language: c -dist: bionic -os: linux - -jobs: - include: - - # #### CPU formats test (gcc) - - os: linux - compiler: gcc - addons: - apt: - packages: &required - # John the Ripper required stuff - - libssl-dev - - zlib1g-dev - # Extra formats and performance - - yasm - - libgmp-dev - - libpcap-dev - - pkg-config - - libbz2-dev - # OpenMP for clang - - libiomp-dev - - # #### CPU formats test (clang) - - os: linux - compiler: clang - addons: - apt: - packages: *required - - # #### OpenCL formats test. Use Trusty (fglrx driver) - - os: linux - dist: trusty - compiler: gcc - addons: - apt: - packages: - # John the Ripper required stuff - - libssl-dev - - zlib1g-dev - # Extra formats and performance - - yasm - - libgmp-dev - - libpcap-dev - - pkg-config - - libbz2-dev - # OpenMP for clang - - libiomp-dev - # OpenCL - - fglrx-dev - - opencl-headers - env: OPENCL="yes" - - # #### MacOS CPU plus OpenCL formats test - - os: osx - osx_image: xcode9.4 - env: OPENCL="yes" - -script: - - .travis/travis-ci.sh diff --git a/.travis/travis-ci.sh b/.travis/travis-ci.sh deleted file mode 100755 index 603e0a518b1..00000000000 --- a/.travis/travis-ci.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - -# if requested, run all tests -if [[ "$TRAVIS_PULL_REQUEST_BRANCH" != "force-travis" ]]; then - - # on the main branch, run all tests - if [[ "$TRAVIS_BRANCH" != "bleeding-jumbo" || "$TRAVIS_PULL_REQUEST" =~ ^[0-9]+$ ]]; then - - # otherwise, run only Linux jobs for now - if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then - echo '---------------------------------- Skipping CI ---------------------------------' - echo 'In order to spare resources, skip Travis CI build.' - echo '--------------------------------------------------------------------------------' - - # Nothing to do. - exit 0 - fi - echo 'Proceeding with build' - fi -fi - -# Need a docker image to run the tests -if [[ "$DOCKER" == "yes" ]]; then - docker run --cap-add SYS_PTRACE -v "$(pwd)":/cwd claudioandre/john:opencl18 sh -c \ - " - cd /cwd; \ - export OPENCL=$OPENCL; \ - export CC=$TRAVIS_COMPILER; \ - export BUILD_OPTS='$BUILD_OPTS'; \ - echo; \ - $0; - " - exit $? -fi - -# ---- Build and test JtR ---- -cd src - -# The testing binary -JTR=../run/john - -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - ./configure --enable-werror CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" - make -sj4 -else - # Address sanitizer instrumented code - export ASAN_OPTIONS=symbolize=1 - export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) - - if [[ "$OPENCL" == "yes" && "$TRAVIS_DIST" == "trusty" ]]; then - # Fix the OpenCL stuff - mkdir -p /etc/OpenCL/vendors - sudo ln -sf /usr/lib/fglrx/etc/OpenCL/vendors/amdocl64.icd /etc/OpenCL/vendors/amd.icd - fi - - # Configure and build - ./configure --enable-werror $BUILD_OPTS - make -sj4 -fi - -# Disable problematic formats before testing -source ../.ci/disable_formats.sh - -echo '---------------------------------- Build Info ----------------------------------' -$JTR --list=build-info -echo '--------------------------------------------------------------------------------' - -if [[ "$OPENCL" == "yes" ]]; then - echo '---------------------------------- OpenCL Info ----------------------------------' - $JTR --list=opencl-devices - echo '---------------------------------------------------------------------------------' -fi - -# Except for MacOS, split tests -if [[ "$OPENCL" == "yes" && "$TRAVIS_OS_NAME" != "osx" ]]; then - echo '== Running $JTR -test=0 --format=opencl ==' - $JTR -test=0 --format=opencl -else - echo '== Running $JTR -test=0 ==' - $JTR -test=0 -fi diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000000..1fffcaf71c4 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,291 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2023 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# Appveyor CI configuration +# More info at https://github.com/openwall/john-packages + +branches: + only: + - test + - release + - bleeding-jumbo + +environment: + global: + PROJ_FOLDER: C:\projects + JTR_FOLDER: C:\projects\JohnTheRipper + BUILD_FOLDER: C:\projects\JohnTheRipper\src + + matrix: + # CygWin 64bits build on Windows Server 2016 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + arch: x86_64 + bits: 64 + doing: deploy + test: yes + location: cygwin64 + # cygwin: install (not needed after Dec 2019) + +install: + - echo '--------------------------------' + - systeminfo | findstr /C:"OS" + - echo '--------------------------------' + - systeminfo + - echo '--------------------------------' + + - cd %BUILD_FOLDER% + - ps: | + if (git log -1 --oneline | Select-String -Pattern "CI: " -Quiet) { + Write-Host "Removing testing commits" + git reset --hard HEAD~1 + } + + - ps: | + if (git log -1 --oneline | Select-String -Pattern "CI: " -Quiet) { + Write-Host "Removing testing commits" + git reset --hard HEAD~1 + } + + - git describe --dirty=+ --always 2>nul > __git.tmp + - set /p gitDescribe=<__git.tmp + - appveyor UpdateBuild -Version "1.9J2-%gitDescribe%" + - git describe --dirty=+ --always 2>nul > __git.tmp + - set /p gitDescribe=<__git.tmp + - echo "JtR 1.9J2+%gitDescribe%" + - echo '--------------------------------' + + # Apply patch(es) + - appveyor DownloadFile "https://raw.githubusercontent.com/openwall/john-packages/main/patches/Remove-peflags-from-the-default-target.patch" -FileName 0001.patch + - git apply 0001.patch + # 1. Remove peflags from the default target on Windows + + # download 64 bits installer + - ps: | + New-Item -Path C:\cygwin64 -ItemType Directory -Force + $exePath = "C:\cygwin64\setup-x86_64.exe" + (New-Object Net.WebClient).DownloadFile('https://cygwin.com/setup-x86_64.exe', $exePath) + + - ps: | + $posixBuildFolder = $env:BUILD_FOLDER -Replace '\\', '/' + + #The location of the CygWin binaries + $cygwinFolder = "C:\$env:Location\bin" + $Env:cygwinPath = "$env:Location\bin" + if ($env:Cygwin -eq "install") { + $cygwinFolder = "C:\tools\cygwin\bin" + $Env:cygwinPath = "tools\cygwin\bin" + } + + function shell($command, $dieOnError = $true) { + + Write-Host "Executing '$command'" + & "$cygwinFolder\bash" -lc ". /etc/profile && cd $posixBuildFolder && $command" + + if ($LASTEXITCODE -ne 0) { + Write-Host "'$command' failed with exit code $LASTEXITCODE! " -ForegroundColor Red -NoNewline + + if ($dieOnError) { + exit $LASTEXITCODE + } + } + } + +before_build: + # If needed (CygWin is not installed) or as a workaround (CygWin update is required) + - ps: | + if ($env:Cygwin -eq "install") { + # To update the AppVeyor worker + #appveyor DownloadFile "http://www.cygwin.com/setup-$env:Arch.exe" -FileName "C:\$env:Location\setup-$env:Arch.exe" + #cmd /c "C:\$env:Location\setup-$env:Arch.exe -q --no-desktop --no-shortcuts --no-startmenu --upgrade-also" + choco install -y cygwin cyg-get + cyg-get libssl-devel libbz2-devel libgmp-devel zlib-devel gcc-core libOpenCL-devel libcrypt-devel make wget rebase perl + } + + # Install required packages and allow extra formats + - ps: | + if ($env:Cygwin -ne "install") { + cmd /c "C:\$env:Location\setup-$env:Arch.exe -q -P libssl-devel -P libbz2-devel -P libgmp-devel -P zlib-devel" + cmd /c "C:\$env:Location\setup-$env:Arch.exe -q -P libOpenCL-devel -P libcrypt-devel -P yasm" + } + +build_script: + - ps: | + Write-Host "--------------------------------------------------------" + Write-Host " ===== Building ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + - ps: | + echo 'Compiler version' + shell "gcc --version" + echo '--------------------------------' + shell "gcc -dM -E -x c /dev/null" + echo '--------------------------------' + + shell "./configure --enable-werror && make -s clean && make -sj2 && make -s strip && mv ../run/john ../run/john-best" + $EXE_NAME = "john-best.exe" + + # The "windows-package" make target depends on default, + # - So it needs the john.exe I built above + shell "cp ../run/$EXE_NAME ../run/john.exe" + + # Make this a Windows package + shell "make -s windows-package" + + # Use symlink.c to produce a tiny john.exe that executes the best SIMD + shell "make windows-tiny-link-to-john MAIN_NAME=$EXE_NAME " + ########################################################################## + # I should strip the tiny john.exe at some time in the future + # - But I can't call a make target that depends on default + # - So, I can't run a make strip here + ########################################################################## + + shell "make check" + + - ps: | + # Needed dlls (Tested on Windows 7 32 bits and Windows 10 64 bits) + xcopy $cygwinFolder\cygwin1.dll ..\run\ + xcopy $cygwinFolder\cygbz2-1.dll ..\run\ + xcopy $cygwinFolder\cygcrypto-3.dll ..\run\ + xcopy $cygwinFolder\cyggomp-1.dll ..\run\ + xcopy $cygwinFolder\cyggmp-10.dll ..\run\ + xcopy $cygwinFolder\cygz.dll ..\run\ + xcopy $cygwinFolder\cygcrypt-2.dll ..\run\ + xcopy $cygwinFolder\cygOpenCL-1.dll ..\run\ + xcopy $cygwinFolder\cyggcc_s-seh-1.dll ..\run\ + + - ps: | + # Save CygWin Dlls + mkdir ..\lib + xcopy $cygwinFolder\*.dll ..\lib\ + +after_build: + - cd "%JTR_FOLDER%\run" + + # Enable ASLR and DEP + - ps: | + Write-Host "---------------------------------------------------------" + Write-Host "== Enable ASLR and DEP for the Windows binary of JtR ==" -ForegroundColor White + Write-Host "---------------------------------------------------------" + + - c:\%cygwinPath%\peflags --dynamicbase=true --nxcompat=true *.exe + + # Compute checksums + - ps: | + Write-Host "--------------------------------------------------------" + Write-Host " ===== Compute and Save Checksums ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + - ps: | + Write-Output "File verification is the process of using an algorithm for verifying the integrity of a computer file. A popular approach is to store checksums (hashes) of files, also known as message digests, for later comparison." | Tee-Object -FilePath ..\checksums.txt + - ps: | + Write-Output "**************************************************************************" | Tee-Object -FilePath ..\checksums.txt -Append + + - ps: | + Get-FileHash -Path .\*.exe | Tee-Object -FilePath ..\checksums.txt -Append + +test_script: + - ps: | + Write-Host "--------------------------------------------------------" + Write-Host " ===== Testing ===== " -ForegroundColor White + Write-Host "--------------------------------------------------------" + + # Build info + - john --list=build-info + + - echo $NT$066ddfd4ef0e9cd7c256fe77191ef43c > tests.in + - echo $NT$8846f7eaee8fb117ad06bdd830b7586c >> tests.in + - echo df64225ca3472d32342dd1a33e4d7019f01c513ed7ebe85c6af102f6473702d2 >> tests.in + - echo 73e6bc8a66b5cead5e333766963b5744c806d1509e9ab3a31b057a418de5c86f >> tests.in + - echo $6$saltstring$fgNTR89zXnDUV97U5dkWayBBRaB0WIBnu6s4T7T8Tz1SbUyewwiHjho25yWVkph2p18CmUkqXh4aIyjPnxdgl0 >> tests.in + + - echo "====> T0:" + - if "%test%" == "yes" ( + john -test-full=0 --format=cpu + ) + + - echo "====> T6.0:" + - john -test=3 -form='dynamic=md5(sha1($s).md5($p))' + - echo "====> T6.1:" + - john -test=3 -form='dynamic=md5(sha1($s.$p).md5($p))' + - echo "====> T6.2:" + - john -test=3 -form='dynamic=md5($p)' + + - echo "====> T10:" + - john tests.in --format=nt --fork=2 --max-run-time=300 + - echo "====> T11:" + - john tests.in --format=raw-sha256 --fork=2 --max-run-time=300 + - echo "====> T12:" + - john tests.in --format=sha512crypt --mask=jo?l[n-q] + + - echo " Ok: successfully" + +after_test: + # Remove the left-over from testing + - del /f /q john.log + - del /f /q john.pot + - del /f /q john-local.conf + + # Remove unused/unneeded stuff + - rmdir "%JTR_FOLDER%\run\ztex" /s /Q + + # Remove hidden .name files and folders + - if NOT "%test%" == "package" del /f /q "%JTR_FOLDER%\azure-pipelines.yml" + - if NOT "%test%" == "package" del /f /q "%JTR_FOLDER%\.cirrus.yml" + - del /f /q "%JTR_FOLDER%\.editorconfig" + - del /f /q "%JTR_FOLDER%\.gitattributes" + - del /f /q "%JTR_FOLDER%\.gitignore" + - del /f /q "%JTR_FOLDER%\.mailmap" + - del /f /q "%JTR_FOLDER%\.pre-commit.sh" + + - if NOT "%test%" == "package" rmdir "%JTR_FOLDER%\.azure" /s /Q + - rmdir "%JTR_FOLDER%\.ci" /s /Q + - rmdir "%JTR_FOLDER%\.circleci" /s /Q + - rmdir "%JTR_FOLDER%\.github" /s /Q + +on_failure: + - dir "%JTR_FOLDER%" /s > dir.txt + - if exist "dir.txt" 7z a -tzip debug_logs.zip "dir.txt" > nul + - if exist "%JTR_FOLDER%\src\config.log" 7z a -tzip debug_logs.zip "%JTR_FOLDER%\src\config.log" > nul + - if exist "%JTR_FOLDER%\src\configure" 7z a -tzip debug_logs.zip "%JTR_FOLDER%\src\configure" > nul + - if exist "%JTR_FOLDER%\src\Makefile" 7z a -tzip debug_logs.zip "%JTR_FOLDER%\src\Makefile" > nul + - if exist "debug_logs.zip" appveyor PushArtifact "debug_logs.zip" + +on_finish: + - if exist "%JTR_FOLDER%\lib" 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=128m -ms=on "optional.7z" "%JTR_FOLDER%\lib" + - if exist "optional.7z" if "%doing%" == "deploy" appveyor PushArtifact "optional.7z" + - move optional.7z c:\ + + - rmdir "%JTR_FOLDER%\lib" /s /Q + - rmdir "%JTR_FOLDER%\.git" /s /Q + - rmdir "%JTR_FOLDER%\src" /s /Q + + - if exist "%JTR_FOLDER%\run\john.exe" 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=128m -ms=on "win_x%bits%.7z" "%JTR_FOLDER%" + - if exist "win_x%bits%.7z" if "%doing%" == "deploy" appveyor PushArtifact "win_x%bits%.7z" + - move "win_x%bits%.7z" c:\ + + - ps: | + if ($Zipfile = Get-ChildItem "c:\win_x$env:Bits.7z") { + Get-FileHash "c:\win_x$env:Bits.7z" + Get-FileHash "c:\optional.7z" + + } else { + Write-Host "--------------------------------------------------------" + Write-Host " ===== No Files to Upload ===== " -ForegroundColor Red + Write-Host "--------------------------------------------------------" + } diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000000..7f7fcc4f444 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,251 @@ +############################################################################### +# _ _ _ _ _____ _ +# | | | | | | | | | __ \(_) +# | | ___ | |__ _ __ | |_| |__ ___ | |__) |_ _ __ _ __ ___ _ __ +# _ | |/ _ \| '_ \| '_ \ | __| '_ \ / _ \ | _ /| | '_ \| '_ \ / _ \ '__| +# | |__| | (_) | | | | | | | | |_| | | | __/ | | \ \| | |_) | |_) | __/ | +# \____/ \___/|_| |_|_| |_| \__|_| |_|\___| |_| \_\_| .__/| .__/ \___|_| +# | | | | +# |_| |_| +# +# Copyright (c) 2019-2022 Claudio André +# +# This program comes with ABSOLUTELY NO WARRANTY; express or implied. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, as expressed in version 2, seen at +# http://www.gnu.org/licenses/gpl-2.0.html +############################################################################### +# Azure DevOps CI configuration +# More info at https://github.com/openwall/john-packages + +stages: +- stage: basic + displayName: Acceptance Test + jobs: + - job: Windows_2019 + displayName: Windows 2019 + pool: + vmImage: 'windows-2019' + variables: + - template: .azure/windows-variables.yml + steps: + - template: .azure/windows-ci.yml + + - job: Windows_2022 + displayName: Windows 2022 + pool: + vmImage: 'windows-2022' + variables: + - template: .azure/windows-variables.yml + steps: + - template: .azure/windows-ci.yml + + - job: Pocl + displayName: Ubuntu 24 w/ OpenCL POCL + pool: + vmImage: 'ubuntu-latest' + container: + image: ghcr.io/openwall/john-ci:ubuntu.opencl + variables: + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + steps: + - template: .azure/linux-ci.yml + + - job: UBI_8 + displayName: Red Hat Ubi 8 + pool: + vmImage: 'ubuntu-latest' + container: + image: ghcr.io/openwall/john-ci:redhat.ubi8 + variables: + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + steps: + - template: .azure/linux-ci.yml + +- stage: functional + displayName: 'Functional Test' + dependsOn: basic + jobs: + - job: cracking + pool: + vmImage: 'ubuntu-latest' + container: + image: ghcr.io/openwall/john-ci:fedora.latest + options: --user=root + variables: + TARGET_ARCH: "NIX" + EXTRA: "full;extra;crack;" + BUILD_OPTS: "" # Can't use --enable-werror, gcc emits warnings + + steps: + - template: .azure/linux-ci.yml + + # Intel OpenCL CPU testing ################################################### + # Tests run on top of: + # - ubuntu:16.04 + # - Intel driver 18.1.0.013 + ############################################################################## + - job: intel_opencl + displayName: Intel OpenCL CPU + timeoutInMinutes: "0" + pool: + vmImage: 'ubuntu-latest' + container: + image: claudioandre/john:opencl + + variables: + TARGET_ARCH: "NIX" + EXTRA: "MY_FULL;OpenCL-full;OpenCL-crack;" + BUILD_OPTS: "--enable-werror" + + steps: + - template: .azure/linux-ci.yml + + # Known issues ############################################################### + # - Can't use '--enable-asan' in intel_opencl Job + # + # #16 0x7f36513fefa0 in dlopen (/lib/x86_64-linux-gnu/libdl.so.2+0xfa0) + # #17 0x7f365242b20f in dlopen (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x3720f) + # #18 0x7f3651b27862 in khrIcdVendorAdd (/usr/lib/x86_64-linux-gnu/libOpenCL.so.1+0x2862) + # #19 0x7f3651b2bcc2 in khrIcdOsVendorsEnumerate (/usr/lib/x86_64-linux-gnu/libOpenCL.so.1+0x6cc2) + # #20 0x7f3650b85a98 in __pthread_once_slow (/lib/x86_64-linux-gnu/libpthread.so.0+0xea98) + # #21 0x7f3651b28325 in clGetPlatformIDs (/usr/lib/x86_64-linux-gnu/libOpenCL.so.1+0x3325) + # #22 0x8f3112 in load_opencl_environment /__w/1/s/src/opencl_common.c:463 + # #23 0x8fade2 in opencl_load_environment /__w/1/s/src/opencl_common.c:879 + # #24 0x8fb637 in opencl_prepare_dev /__w/1/s/src/opencl_common.c:2362 + # #25 0xa0c234 in init /__w/1/s/src/opencl_rawsha256_fmt_plug.c:550 + # #26 0x840956 in fmt_init /__w/1/s/src/formats.c:80 + # #27 0x824526 in benchmark_all /__w/1/s/src/bench.c:782 + # #28 0x851f08 in john_run /__w/1/s/src/john.c:1697 + ############################################################################## + +- stage: fuzz + displayName: 'Fuzzing' + dependsOn: functional + jobs: + - job: zzuf + pool: + vmImage: 'ubuntu-latest' + container: + image: ghcr.io/openwall/john-ci:ubuntu.opencl + + variables: + TARGET_ARCH: "NIX" + EXTRA: "ZZUF_FUZZ" + BUILD_OPTS: "--enable-fuzz" + + steps: + - template: .azure/linux-ci.yml + + # There is a 60 minutes job limit (so, I need the timeoutInMinutes) + # - job: afl + # timeoutInMinutes: 0 + # container: + # image: ghcr.io/openwall/john-ci:ubuntu.opencl + + # variables: + # TARGET_ARCH: "NIX" + # EXTRA: "AFL_FUZZ" + # BUILD_OPTS: "--enable-fuzz --disable-native-tests" + # CC: "afl-clang-fast" + + # steps: + # - template: .azure/linux-ci.yml + + # Runs "--fuzz" + - job: internal + pool: + vmImage: 'ubuntu-latest' + container: + image: ghcr.io/openwall/john-ci:ubuntu.opencl + + variables: + TARGET_ARCH: "NIX" + EXTRA: "MY_INTERNAL" + BUILD_OPTS: "--enable-fuzz" + + steps: + - template: .azure/linux-ci.yml + + # Runs "--test-full=1" + - job: full + pool: + vmImage: 'ubuntu-latest' + container: + image: ghcr.io/openwall/john-ci:ubuntu.opencl + + variables: + TARGET_ARCH: "NIX" + EXTRA: "MY_FULL;full" + BUILD_OPTS: "--enable-fuzz" + + steps: + - template: .azure/linux-ci.yml + +- stage: delivery + displayName: Delivery + dependsOn: basic + jobs: + - job: Build + displayName: Build Package + timeoutInMinutes: "0" + pool: + vmImage: 'windows-2022' + variables: + - template: .azure/windows-variables.yml + + steps: + - template: .azure/checkout.yml + - template: .azure/windows-system-info.yml + + - ${{ if false }}: + - template: .azure/windows-build-to-delivery.yml + - template: .azure/windows-push-artifacts.yml + - template: .azure/windows-pull-artifacts.yml + - template: .azure/windows-testing.yml + parameters: + fullTest: 'no' + johnBinary: 'john' + johnDirectory: $(System.ArtifactsDirectory)\JtR\run + +- stage: deploy + displayName: Check Deploy + dependsOn: delivery + jobs: + - job: Validate_19 + displayName: Validate 2019 + pool: + vmImage: 'windows-2019' + variables: + - template: .azure/windows-variables.yml + steps: + - checkout: none + + - ${{ if false }}: + - template: .azure/windows-pull-artifacts.yml + - template: .azure/windows-testing.yml + parameters: + fullTest: 'yes' + johnBinary: 'john' + johnDirectory: $(System.ArtifactsDirectory)\JtR\run + + - job: Validate_22 + displayName: Validate 2022 + pool: + vmImage: 'windows-2022' + variables: + - template: .azure/windows-variables.yml + steps: + - checkout: none + + - ${{ if false }}: + - template: .azure/windows-pull-artifacts.yml + - template: .azure/windows-testing.yml + parameters: + fullTest: 'yes' + johnBinary: 'john' + johnDirectory: $(System.ArtifactsDirectory)\JtR\run \ No newline at end of file diff --git a/run/john-local.conf b/run/john-local.conf new file mode 100644 index 00000000000..d9eade9e624 --- /dev/null +++ b/run/john-local.conf @@ -0,0 +1,17 @@ +[Local:Disabled:Formats] +RACF-KDFAES = Y +RAR = Y +wpapsk-opencl = Y +wpapsk-pmk-opencl = Y +krb5pa-md5-opencl = Y +o5logon-opencl = Y +mscash-opencl = Y +salted_sha-opencl = Y +bitlocker-opencl = Y +pgpdisk-opencl = Y +krb5tgs-opencl = Y +pfx-opencl = Y +mscash2-opencl = Y +argon2-opencl = Y +keepass-argon2-opencl = Y +raw-SHA512-free-opencl = Y